Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Turn AutoFilters Off

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Turn AutoFilters Off

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoFilters Joli Excel Worksheet Functions 1 March 21st 06 09:14 PM
How to set up AutoFilters? MS Suzanne Excel Worksheet Functions 1 June 30th 05 03:53 AM
autofilters Diego Villaseñor Fernández Excel Worksheet Functions 0 January 13th 05 11:27 PM
VBA and Autofilters Frank Haverkamp Excel Programming 2 January 10th 04 01:53 AM
Userforms and autofilters - Autofilters don't seen to work with userform No Name Excel Programming 3 August 28th 03 05:42 PM


All times are GMT +1. The time now is 07:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"