I have the following code generating a run time error on a protected sheet.
Error message is: Method "Goto' of 'object' _Application failed
This is used to simply lookup the current date.
The issue begins at "Application.Goto Rng, True"
Any assistance would be appreciated and thanks in advance.
Sub Todays_Date_Click()
Dim FindString As Date
Dim Rng As Range
FindString = CLng(Date)
With Sheets("Sheet Name").Range("1:")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End Sub
Error message is: Method "Goto' of 'object' _Application failed
This is used to simply lookup the current date.
The issue begins at "Application.Goto Rng, True"
Any assistance would be appreciated and thanks in advance.
Sub Todays_Date_Click()
Dim FindString As Date
Dim Rng As Range
FindString = CLng(Date)
With Sheets("Sheet Name").Range("1:")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End Sub