View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Philip Philip is offline
external usenet poster
 
Posts: 156
Default Problems copying Autofiltered rows & SpecialCells

Hi,

I am filtering a selection based on one column NOT being zero using
Autofilter. The rows that are not zero have to be copied.

Unfortunately, it is possible for no rows to be grater than zero, so
SpecialCells returns no rows to copy and I get an error...

Here is my code:
Selection.AutoFilter Field:=7, Criteria1:="<0.00000000"

[B3:C122,G3:G122].Select

Selection.SpecialCells(xlCellTypeVisible).Copy ' <<<< ERROR HERE

How can I do this without an error... that is, check the number of rows that
are visible in my range and if it's zero, do something else...

thanks

Philip