I've written this short code for you:
Private Sub Workbook_Open()
On Error Resume Next
Application.Goto Sheet1.Rows(2).Find(Format$(Date,"dd/mmm"), , xlValues, xlWhole).Item(2, 1), True
End Sub
If (without the line 'On Error Resume Next') it fails, try only this:
1. Write in the immediate window
(don't forget the leading '?'). If it fails, you wrote incorrect sheet codename; use the correct one. If the codename 'Sheet1' is correct, then
2. write in the immediate window (use copy/paste of course)
? Sheet1.Rows(2).Find(Format$(Date,"dd/mmm"), , xlValues, xlWhole) Is Nothing
If it returns 'True', the date wasn't found, it's missing in your sheet; fix it. That's why the subroutine begins with 'On Error Resume Next'. If you want to say something to user in this case, change the code into
Private Sub Workbook_Open()
On Error Resume Next
Application.Goto Sheet1.Rows(2).Find(Format$(Date,"dd/mmm"), , xlValues, xlWhole).Item(2, 1), True
if Err Then Application.Speech.Speak "Sorry buddy, the today's date is missing in the sheet", True
End Sub
Bookmarks