Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
Hi
FOR INFO ONLY - I have placed all three rows of code together for you viewing, normally they all are in their own IF statement.
I need a bit of advice, looking at the code below. I can not see any difference, however I am having an issue with this code for column B ONLY see image. Column B is empty there are no hidden items in it and there is nothing in the code that states that column B should START at one down.
As you can see it does not put the data into the right place for column B ONLY all other column data is fine.
If I change the code to this:
Then the problem fixes itself.
I guess my question are
I have a rough idea of what the code is doing, could someone break it down with comments so i know what each part of the code is doing.
Thanks in advance
FOR INFO ONLY - I have placed all three rows of code together for you viewing, normally they all are in their own IF statement.
I need a bit of advice, looking at the code below. I can not see any difference, however I am having an issue with this code for column B ONLY see image. Column B is empty there are no hidden items in it and there is nothing in the code that states that column B should START at one down.
VBA Code:
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "A").End(xlUp).Row + 1, "A").Offset(y, 0).Value = HtmlText
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "B").End(xlUp).Row + 1, "B").Offset(y, 0).Value = HtmlText
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "C").End(xlUp).Row + 1, "C").Offset(y, 0).Value = HtmlText
As you can see it does not put the data into the right place for column B ONLY all other column data is fine.
If I change the code to this:
VBA Code:
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "A").End(xlUp).Row + 1, "A").Offset(y, 0).Value = HtmlText
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "A").End(xlUp).Row + 1, "B").Offset(y, 0).Value = HtmlText
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "C").End(xlUp).Row + 1, "C").Offset(y, 0).Value = HtmlText
I guess my question are
- WHY is this happening for COLUMN B only?
- And how should the code be written?
VBA Code:
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "A").End(xlUp).Row + 1, "A").Offset(y, 0).Value = HtmlText
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "A").End(xlUp).Row + 1, "B").Offset(y, 0).Value = HtmlText
wsSheet.Cells(Sheet3.Cells(Sheet3.Rows.Count, "A").End(xlUp).Row + 1, "C").Offset(y, 0).Value = HtmlText
I have a rough idea of what the code is doing, could someone break it down with comments so i know what each part of the code is doing.
Thanks in advance