kingconsto
New Member
- Joined
- Apr 19, 2017
- Messages
- 32
Hello,
I have a spreadsheet and I would like to search from N5 forward and select the first empty cell (which in this case is AG5 but changes every day i.e AH5,AI5) and copy the column data to the left of that empty cell (in this case (AF5-AF157) and paste it to a new worksheet. Column count and end(xltoright/left) is not working because there is data from N5-AF5, blank cells from AG5-AS5, data in AT5, blank cell, data in AV5-AW5. This is what I have now.
lastcolumn = Range("N5" & Columns.Count).End(xlToRight).Column
Range(Cells(5, lastcolumn), Cells(157, lastcolumn)).Select
Selection.Copy
Thanks for the help!
I have a spreadsheet and I would like to search from N5 forward and select the first empty cell (which in this case is AG5 but changes every day i.e AH5,AI5) and copy the column data to the left of that empty cell (in this case (AF5-AF157) and paste it to a new worksheet. Column count and end(xltoright/left) is not working because there is data from N5-AF5, blank cells from AG5-AS5, data in AT5, blank cell, data in AV5-AW5. This is what I have now.
lastcolumn = Range("N5" & Columns.Count).End(xlToRight).Column
Range(Cells(5, lastcolumn), Cells(157, lastcolumn)).Select
Selection.Copy
Thanks for the help!