Hi there
I am using the following macro to find the date entered in e2 in a range a:a the date in both cell and column is in dd/mm/yyyy format. When i run the macro I get a compile error: Cant find project or library and TRIM is highlighted. Here is the code i am using.
I am using the following macro to find the date entered in e2 in a range a:a the date in both cell and column is in dd/mm/yyyy format. When i run the macro I get a compile error: Cant find project or library and TRIM is highlighted. Here is the code i am using.
Code:
Sub Find_First()
Dim FindString As String
Dim Rng As Range
FindString = Sheets("Bookings").Range("e2").Value
If Trim(FindString) <> "" Then
With Sheets("Bookings").Range("A:A")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
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 If
End Sub