View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Determined if filtered range is empty

There is no difference.


? xlcelltypevisible
12
? xlvisible
12


--
Regards,
Tom Ogilvy


"Fred Smith" wrote in message
...
Thanks for both responses. It works great.

Is there any difference between xlCellTypeVisible and xlVisible? I can't
find xlVisible in Help, but it seems to work just as well, and it's a lot
easier to type.

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"Ron de Bruin" wrote in message
...
Try this Fred

Sub test()
Selection.AutoFilter Field:=3, Criteria1:=Household
If

ActiveSheet.AutoFilter.Range.Cells.SpecialCells(xl CellTypeVisible).Count _
= Selection.Columns.Count Then MsgBox "no cells"
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Fred Smith" wrote in message

...
I am setting an Autofilter with:

Selection.AutoFilter Field:=3, Criteria1:=Household

However, sometimes Household doesn't exist in the table. How do I test

to
see if the selected range is empty? Is there a way to test whether

Household
exists in the Criteria1 list? Or is there a test to see if the
Autofilter.Range is empty?

--
Thanks,
Fred
Please reply to newsgroup, not e-mail