Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
looking for autofilter with code
I am wanting to know if there is code that can look to see if any field within autofilter are currently filtering. I would like to have cod that is dependent on whether or not this is true. I currently have to just tell every field to stop filtering even i they're not and this takes a long time and needlessly a lot of th time Thank -- lcorey ----------------------------------------------------------------------- lcoreyl's Profile: http://www.excelforum.com/member.php...nfo&userid=204 View this thread: http://www.excelforum.com/showthread.php?threadid=26232 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
looking for autofilter with code
Following will rebuild the autofilter,all existing filters are cleared. If you want to SET a new filter then add the arguments to the second autofilter call Sub ResetAutofilter(Optional wks As Worksheet,) If wks Is Nothing Then Set wks = ActiveSheet With wks If .AutoFilterMode Then With .AutoFilter.Range .AutoFilter 'First call clears an existing autofilter. .AutoFilter 'Sets an empty autofilter. '.AutoFilter Field:=1,Criteria1:="a*" End With End If End With End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool lcoreyl wrote: I am wanting to know if there is code that can look to see if any fields within autofilter are currently filtering. I would like to have code that is dependent on whether or not this is true. I currently have to just tell every field to stop filtering even if they're not and this takes a long time and needlessly a lot of the time Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
looking for autofilter with code
This may helpWorksheets("Sheet1").ShowAllData-- Don GuillettSalesAid
"lcoreyl" wrote in message ... I am wanting to know if there is code that can look to see if any fields within autofilter are currently filtering. I would like to have code that is dependent on whether or not this is true. I currently have to just tell every field to stop filtering even if they're not and this takes a long time and needlessly a lot of the time Thanks -- lcoreyl ------------------------------------------------------------------------ lcoreyl's Profile: http://www.excelforum.com/member.php...fo&userid=2042 View this thread: http://www.excelforum.com/showthread...hreadid=262326 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
looking for autofilter with code
to answer your specific Question:
Dim w as Worksheet, f as Filter Set w = Activesheet For Each f In w.AutoFilter.Filters If f.On Then End if Next Look at the object browser for the filter object to see properties. -- Regards, Tom Ogilvy "lcoreyl" wrote in message ... I am wanting to know if there is code that can look to see if any fields within autofilter are currently filtering. I would like to have code that is dependent on whether or not this is true. I currently have to just tell every field to stop filtering even if they're not and this takes a long time and needlessly a lot of the time Thanks -- lcoreyl ------------------------------------------------------------------------ lcoreyl's Profile: http://www.excelforum.com/member.php...fo&userid=2042 View this thread: http://www.excelforum.com/showthread...hreadid=262326 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel vba autofilter code | Excel Discussion (Misc queries) | |||
Excel VBA AutoFilter code | Excel Discussion (Misc queries) | |||
vba code on autofilter | Excel Discussion (Misc queries) | |||
Autofilter code | Excel Discussion (Misc queries) | |||
Newbie : Autofilter thru code ? | Excel Programming |