I have no need to populate the search box when submitting guest check in details, the code i am using is below, is it possible to ad additional code to avoid this error. Thanks in advance!!!!! lblrow.Caption = .Row 'error line
Private Sub Txtforename_Change()
Dim rng As Range
lblrow.Visible = False
With Sheets("Report")
Set rng = Range(.Cells(1, 1), .Cells(1, 1).End(xlDown))
End With
With rng.Find(Txtguestsearch, lookat:=xlWhole)
lblrow.Caption = .Row
End With
End Sub
FINDstatement will throw errors if a value inTxtguessearchisn't found. If you expect it to be blank you could testIf Trim(Txtguestsearch) = "" Then.Rngmay be better set asSet Rng = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp)).