mistermarc
New Member
- Joined
- Dec 11, 2013
- Messages
- 2
Hi there!
Until yesterday I had a perfectly fine working date macro on my calendar sheet allowing me to go to "today's date".
However, now I am getting a "Runtime Error 13-Mismatch":
The code is as follows:
Sub GotoDate()
Dim LastCell As Long, x As Long
LastCell = Columns(2).Cells(Columns(2).Cells.Count).End(xlUp).Row
For x = 1 To LastCell + 1
If Cells(x, 2) = Date Then
Cells(x, 2).Select
End
End If
Next
If x > LastCell Then MsgBox "unable to find today's date in column B"
End Sub
In this formula " If Cells(x, 2) = Date Then " is marked yellow.
I would be grateful for any suggestion on how to fix this.
Many thanks.
Until yesterday I had a perfectly fine working date macro on my calendar sheet allowing me to go to "today's date".
However, now I am getting a "Runtime Error 13-Mismatch":
The code is as follows:
Sub GotoDate()
Dim LastCell As Long, x As Long
LastCell = Columns(2).Cells(Columns(2).Cells.Count).End(xlUp).Row
For x = 1 To LastCell + 1
If Cells(x, 2) = Date Then
Cells(x, 2).Select
End
End If
Next
If x > LastCell Then MsgBox "unable to find today's date in column B"
End Sub
In this formula " If Cells(x, 2) = Date Then " is marked yellow.
I would be grateful for any suggestion on how to fix this.
Many thanks.