what the code below is doing is it is counting the rows in a named range
then it is counting the number of visible cells in that range
the error comes when there are no visible cells in the range,
please advise on how to avoid this the solution should result in tt = 0 so the code will GoTo clear1
If tb1 = "" Then GoTo clear1
If tb1 <> "" Then sh.ListObjects("ArtistList").Range.AutoFilter Field:=fld1, Criteria1 _
:="=*" & fltr1 & "*", Operator:=xlAnd
t = Sheets("Artist List").Range("AAA").Rows.Count
If Not IsError(t - Sheets("Artist List").Range("AAA").SpecialCells(12).Count) Then tt = t - Sheets("Artist List").Range("AAA").SpecialCells(12).Count <--this line is Run-time error '1004:application defined or object defined error
ttt = t - tt
If ttt = 0 Then GoTo clear1
If ttt > 0 Then Alist1.SpecialCells(xlCellTypeVisible).Copy
Bookmarks