Hello and thank you in advance.
I have a sheet with data in column A and I'm going to input the date the data was received in column B. each week I'll add more data and I need a macro to find the end of the current set of dates and fill in today's date to the end all the new data.
On the attached test sheet I tried this which finds and selects the first empty cell but where I'm stuck is creating the string to location and select from the first empty in column B to the end of the data in column A. I can't use a static reference to cells because the data amount and location will change week to week.
Sub test()
Dim lr As Long
Dim Ar As Long
Dim rng As Range
Dim ang As Range
On Error Resume Next
lr = Columns("B:B").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set rng = Range("B" & lr).Offset(1, 0).Select
Ar = Columns("B" & rng & "B").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set ang = Range("R" & rng & "R" & Ar)
ang = "=today()"
End Sub
Test sheet attached to make this easier.
Bookmarks