I have a spread sheet and I need to look for the last column that has data in it. Then I need to copy this column and copy it to the next blank column.
Is there a way to do this?
I’ve managed to do it with rows using:
lastrowSrc = Sheets("Overview").Range("B" & Rows.Count).End(xlUp).Row
However this puts B12 in the range, using columns.count simply puts in the number of the column, not the letter
To get the exact column in a worksheet, use this code.
EDIT: This is courtesy @brettdj. You can also use the range object to find the last column
To get the last column of a particular row, say row 1 use this
Where ws is your relevant worksheet.
Similarly for Row see this.