Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am hoping someone may be able to help with this problem please.
I have a general routine which looks at several worksheets and sets up an AutoFilter but there may be occasions when the Criteria I have built into my code is not satisfied. I am selecting through code an AutoFilter on a Worksheet and setting the criteria to filter on as "Open" however if the criteria isn't satisfied then the Filter returns ALL data in the selection this really messes up my sheet I am storing my results into. Is there any way I can detect if the criteria doesn't exist such as for example If AutoFilter.Criteria NotExists Then Skip I would be grateful for any help offered Thanks Fred. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to both Steve and Tom.
Tom this is just the thing I was hoping for thanks a Million. Fred "Tom Ogilvy" wrote in message ... Dim rng as Range set rng = Activesheet.Autofilter.Range.columns(1).specialcel ls(xlVisible) ' only the header row is visible if no row meets the criteria if rng.count = 1 then ' no visible rows, criteria not met End if -- Regards, Tom Ogilvy Frederick wrote in message ... I am hoping someone may be able to help with this problem please. I have a general routine which looks at several worksheets and sets up an AutoFilter but there may be occasions when the Criteria I have built into my code is not satisfied. I am selecting through code an AutoFilter on a Worksheet and setting the criteria to filter on as "Open" however if the criteria isn't satisfied then the Filter returns ALL data in the selection this really messes up my sheet I am storing my results into. Is there any way I can detect if the criteria doesn't exist such as for example If AutoFilter.Criteria NotExists Then Skip I would be grateful for any help offered Thanks Fred. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom I have tried out the code and it works perfect.
Thanks once again. Fred "Tom Ogilvy" wrote in message ... Dim rng as Range set rng = Activesheet.Autofilter.Range.columns(1).specialcel ls(xlVisible) ' only the header row is visible if no row meets the criteria if rng.count = 1 then ' no visible rows, criteria not met End if -- Regards, Tom Ogilvy Frederick wrote in message ... I am hoping someone may be able to help with this problem please. I have a general routine which looks at several worksheets and sets up an AutoFilter but there may be occasions when the Criteria I have built into my code is not satisfied. I am selecting through code an AutoFilter on a Worksheet and setting the criteria to filter on as "Open" however if the criteria isn't satisfied then the Filter returns ALL data in the selection this really messes up my sheet I am storing my results into. Is there any way I can detect if the criteria doesn't exist such as for example If AutoFilter.Criteria NotExists Then Skip I would be grateful for any help offered Thanks Fred. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple criteria in autofilter | Excel Worksheet Functions | |||
Autofilter - Supply Criteria | Excel Discussion (Misc queries) | |||
autofilter isnt working | Excel Discussion (Misc queries) | |||
Improve autofilter combine conditionals with filter criteria | Excel Worksheet Functions | |||
Displaying autofilter criteria | Excel Worksheet Functions |