av8tordude
09-28-2012, 01:53 PM
The code below finds the exact date in A5, but if no date is listed, I would like to find the closet date that is in A5. Can someone assist. Thanks
Dim My_Row As Long
On Error Resume Next
My_Row = 0
My_Row = Application.WorksheetFunction.Match(Range("A5"), Range("A9:A10009"), 0)
On Error GoTo 0
If My_Row <> 0 Then
My_Row = My_Row + 8
Application.EnableEvents = False
Range("A" & My_Row).Activate
Application.EnableEvents = True
End If
Dim My_Row As Long
On Error Resume Next
My_Row = 0
My_Row = Application.WorksheetFunction.Match(Range("A5"), Range("A9:A10009"), 0)
On Error GoTo 0
If My_Row <> 0 Then
My_Row = My_Row + 8
Application.EnableEvents = False
Range("A" & My_Row).Activate
Application.EnableEvents = True
End If