I have a worksheet with a spinner, which changes the year...The sheet is setup to look like a calendar (4 weeks) with Monday thru Saturday visible (work week) Sunday column is hidden with all twelve months on the same worksheet. The different months then change the date of each day based upon the year selected with a formula.
I'm trying to create a command button that will take the user to the cell with the current date (today()) by scrolling the worksheet. I have the following code, which isn't working currently. My dates are formatted as "mmm-dd" with the command button calling the sub listed below; however, the code is not working currently. Could anyone help me? The error is run-time error 91 Object Variable or With Block Variable not set on the Cells.Find line...
I'm trying to create a command button that will take the user to the cell with the current date (today()) by scrolling the worksheet. I have the following code, which isn't working currently. My dates are formatted as "mmm-dd" with the command button calling the sub listed below; however, the code is not working currently. Could anyone help me? The error is run-time error 91 Object Variable or With Block Variable not set on the Cells.Find line...
Code:
Sub FindToday()
Dim sheetdate As String
sheetdate = Format(Date, "mmm-dd")
Cells.Find(What:=sheetdate, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End Sub
Last edited: