View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
thomsonpa thomsonpa is offline
external usenet poster
 
Posts: 31
Default VBA code for if no visible cells after filter goto next stage

I an running filters in VBA then copying the results to another worksheet on
the next available line. I have a challenge, that when there is nothing to
copy (i.e. the filter results are blank), I cannot get the VBA to go to the
next stage.

I have tried

Selection.AutoFilter Field:=19, Criteria1:="<"

Sheets("IMPORT").Activate
Sheets("IMPORT").Range("B2:B120").Select

If Selection.SpecialCells(xlCellTypeVisible) Then

'do something

else

'do something else

end if

But this results in an error.

Any help please.