Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet that may or may not have the AutoFilters turned on. I need
to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if you mean having each filter set to show 'all' then something like this
might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I actually mean the the drop-down arrows for the filters are on and I need
them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Right, this code should reset each of the drop-down auto-filters in .rows(X)
to display 'All' records in that row, thus turning them off. Ie if column B contains month names (Jan, Feb, etc etc) and you had it set to only show January, this code will reset the filter to show them all (ie they're now off) "Jasmine" wrote: I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or did you mean you wanted to completely remove the autofilter? (so that the
drop-down boxes are no longer there)? "Jasmine" wrote: I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if you want to remove auto-filter, then
With Sheets("MySheet") .Rows(1).AutoFilter End With should work hth J "Jasmine" wrote: I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes. I need to completely remove the filters.
"Gixxer_J_97" wrote: or did you mean you wanted to completely remove the autofilter? (so that the drop-down boxes are no longer there)? "Jasmine" wrote: I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
worksheets("Sheet1").autofiltermode=false
is one way. Jasmine wrote: I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! -- Dave Peterson |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Activesheet.AutoFilterMode = False
works whether there is an autofilter on the sheet or not. -- Regards, Tom Ogilvy "Jasmine" wrote in message ... I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave & Tom - would that reset them all to show 'all' items in the column, or
remove the autofilter from the sheet? thx! J "Tom Ogilvy" wrote: Activesheet.AutoFilterMode = False works whether there is an autofilter on the sheet or not. -- Regards, Tom Ogilvy "Jasmine" wrote in message ... I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Remove them from the sheet.
-- Regards, Tom Ogilvy "Gixxer_J_97" wrote in message ... Dave & Tom - would that reset them all to show 'all' items in the column, or remove the autofilter from the sheet? thx! J "Tom Ogilvy" wrote: Activesheet.AutoFilterMode = False works whether there is an autofilter on the sheet or not. -- Regards, Tom Ogilvy "Jasmine" wrote in message ... I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And if there isn't one, that will add one. Don't believe that is what he
wants. -- Regards, Tom Ogilvy "Gixxer_J_97" wrote in message ... if you want to remove auto-filter, then With Sheets("MySheet") .Rows(1).AutoFilter End With should work hth J "Jasmine" wrote: I actually mean the the drop-down arrows for the filters are on and I need them to be off. "Gixxer_J_97" wrote: if you mean having each filter set to show 'all' then something like this might help With Sheets("MySheet") For i = 1 To Sheets("MySheet").UsedRange.Columns.count '- 1 .Rows(1).AutoFilter field:=i Next i End With change the argument of .Rows() to match what row your filters are in "Jasmine" wrote: I have a worksheet that may or may not have the AutoFilters turned on. I need to have the filters off before I run the macro I have written. How can I incorporate this into my macro? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
AutoFilters | Excel Worksheet Functions | |||
How to set up AutoFilters? | Excel Worksheet Functions | |||
autofilters | Excel Worksheet Functions | |||
VBA and Autofilters | Excel Programming | |||
Userforms and autofilters - Autofilters don't seen to work with userform | Excel Programming |