Hi All,
I'm absolutely useless with VBA, but learning bit by bit. As part of a larger project, I want to have a macro that asks the user for input (of a date) and then finds and selects the cell containing that date. Ideally the date format doesn't matter, but I can deal with that. I could swear the code below was working for me, but then I fiddled with some things and can't get it back again and can't figure out why. I get Runtime Error 13, Type Mismatch. I'm sure this is an easy fix, so any help would be greatly appreciated:
Sub FindDate()
Dim myRange As Range
Dim myDate As String
Set myRange = ActiveSheet.Range("B11, B17")
myDate = Application.InputBox("Enter Date")
With myRange
.Find(what:=myDate, After:=Cells(1, 1), LookIn:=xlValues, Lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Select
End With
End Sub
Bookmarks