Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
looking for autofilter with code
Tom Ogilvy Wrote: It is unclear who you are responding to, but if you are responding t me, I used neither of those constructs. The code I posted will work. sorry, i was unclear: I copied and pasted your code and got "object variable or with bloc variable not set". I figured you meant to add in f = Filter so I adde that as the third line, but then it errored for "argument not optional" -- 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
I copied this out of a module where it worked very well: (just for
illustration - built around the code I posted). Sub CheckFilters() Dim w As Worksheet, f As Filter Set w = ActiveSheet If w.AutoFilterMode = False Then MsgBox "Autofilter not in effect" Exit Sub End If i = 0 For Each f In w.AutoFilter.Filters i = i + 1 If f.On Then MsgBox "filter in cell " & _ w.AutoFilter.Range(1, i).Address & _ " is on" End If Next End Sub Again, whatever changes you made were not required and the lines you show (your own creation) are incorrect. -- Regards, Tom Ogilvy "lcoreyl" wrote in message ... Tom Ogilvy Wrote: It is unclear who you are responding to, but if you are responding to me, I used neither of those constructs. The code I posted will work. sorry, i was unclear: I copied and pasted your code and got "object variable or with block variable not set". I figured you meant to add in f = Filter so I added that as the third line, but then it errored for "argument not optional". -- 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 | |||
vba code on autofilter | Excel Discussion (Misc queries) | |||
Autofilter code | Excel Discussion (Misc queries) | |||
looking for autofilter with code | Excel Programming | |||
looking for autofilter with code | Excel Programming | |||
looking for autofilter with code | Excel Programming |