I am trying to create a macro that I can click on so that wherever I am in a worksheet, it will zip me over to the cell in column A that has the date closest to today's date.
I set it up initially by recording a macro and searching for a date I already knew was in the column as a starter.
Then I tried to add a DIM based on other posts I found on this forum/google search:
All I did was add the two definition lines at the top and change the specific date "8/13/2020" to the variable todayish for the What.
This gets me an error:
Run-time error '91':
Object variable or With block variable not set
I'm not sure what I'm doing wrong?
Any help would be appreciated.
I set it up initially by recording a macro and searching for a date I already knew was in the column as a starter.
Then I tried to add a DIM based on other posts I found on this forum/google search:
VBA Code:
Sub FindToday()
Dim myDate As Date
myDate = Date
'
Columns("A:A").Select
Selection.Find(What:=myDate, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
End Sub
All I did was add the two definition lines at the top and change the specific date "8/13/2020" to the variable todayish for the What.
This gets me an error:
Run-time error '91':
Object variable or With block variable not set
I'm not sure what I'm doing wrong?
Any help would be appreciated.