Hello again you beautiful people,
Another issue that is driving me insane.
Ok, I have a imported spreadsheet where the columns change on a regular basis so I have to add a helper column as an additional column the end which autofils team members down to the last row.
I know how to find the last column to add this helper column and I know how to count the last row in a predefined column and that the autofill function works fine (for example I am counting column A below)
Now this is where my problem is, as my data will not always be in column A, one day it could be in B and another Z! So I can't program the macro as I don't know the last column of data each day to rows.count.![]()
Dim lastRow As Long Set sht = ThisWorkbook.Worksheets("Sheet1") lastRow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
I am not sure if it can be done but is there a way to do something like below:
lastRow = sht.Cells(sht.Rows.Count, "last_column").End(xlUp).Row[/CODE]
As always, any help will be greatly appreciated.
Bookmarks