Hi guys
I need some help with this. As you can see from the code below I need some reference to detect whether or not there are any rows matching the autofilter criteria. I tried to use 'Cells (6,37)' but if the criteria is not in row 6 it fails. Hoping you can help. I feel it must be something quite simple but I can't see it.
Thanks
Private Sub CommandButton1_Click()
Sheets("Carry-In A1").Select
With Sheets("Carry-In A1")
.AutoFilterMode = False
.Range("a5:bb5").AutoFilter
.Range("A5:BB5").AutoFilter Field:=37, Criteria1:="BAF080"
End With
If XXXXXXX <> "BAF080" Then
MsgBox "There are no records to display"
Else
If XXXXXXXX = "BAF080" Then
CountVisRows
Sheets("Carry-In A1").Select
FormCDEL.Show
End If
End Sub
Bookmarks