+ Reply to Thread
Results 1 to 12 of 12

Turn AutoFilters Off

  1. #1
    Jasmine
    Guest

    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. #2
    Gixxer_J_97
    Guest

    RE: 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. #3
    Jasmine
    Guest

    RE: 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. #4
    Gixxer_J_97
    Guest

    RE: 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. #5
    Gixxer_J_97
    Guest

    RE: 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. #6
    Gixxer_J_97
    Guest

    RE: 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. #7
    Jasmine
    Guest

    RE: 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. #8
    Dave Peterson
    Guest

    Re: 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. #9
    Tom Ogilvy
    Guest

    Re: Turn AutoFilters Off

    Activesheet.AutoFilterMode = False

    works whether there is an autofilter on the sheet or not.

    --
    Regards,
    Tom Ogilvy

    "Jasmine" <Jasmine@discussions.microsoft.com> wrote in message
    news:23CC71AC-6B5F-43C6-8D4C-57FDB502842C@microsoft.com...
    > 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. #10
    Gixxer_J_97
    Guest

    Re: 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" <Jasmine@discussions.microsoft.com> wrote in message
    > news:23CC71AC-6B5F-43C6-8D4C-57FDB502842C@microsoft.com...
    > > 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. #11
    Tom Ogilvy
    Guest

    Re: Turn AutoFilters Off

    Remove them from the sheet.

    --
    Regards,
    Tom Ogilvy


    "Gixxer_J_97" <GixxerJ97@discussions.microsoft.com> wrote in message
    news:54199583-F7BC-4EA7-AB29-091BE94B3EB9@microsoft.com...
    > 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" <Jasmine@discussions.microsoft.com> wrote in message
    > > news:23CC71AC-6B5F-43C6-8D4C-57FDB502842C@microsoft.com...
    > > > 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. #12
    Tom Ogilvy
    Guest

    Re: 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" <GixxerJ97@discussions.microsoft.com> wrote in message
    news:5824E9D7-D20B-4F79-82EA-26900008A8C4@microsoft.com...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1