+ Reply to Thread
Results 1 to 6 of 6

Macro code to add Autofilter for all sheets except certain ones

  1. #1
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Macro code to add Autofilter for all sheets except certain ones

    Hello,

    I would like to add autofilter for all sheets (all of them have same layout and heading range: "B3-W3") except 3 sheets named: "Main Page", "Input Data", "Setup".

    Could you pls help me with VBA code which should add it?

    Thanks in advance for your help

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro code to add Autofilter for all sheets except certain ones

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Re: Macro code to add Autofilter for all sheets except certain ones

    Hi John, thanks a lot, however it doesn't work. Probably it will be caused because of my heading's range B3-W3. Since I am still VBA newbie I don't know overwrite this command.
    .Range(.Cells(1, 1), .Cells(1, x)).AutoFilter
    Last edited by Tapyr; 09-14-2015 at 09:13 AM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro code to add Autofilter for all sheets except certain ones

    Try:

    Please Login or Register  to view this content.
    Instead.

  5. #5
    Forum Contributor
    Join Date
    09-10-2012
    Location
    Slovakia
    MS-Off Ver
    Excel 365
    Posts
    176

    Re: Macro code to add Autofilter for all sheets except certain ones

    Works perfectly. Thank you very much!!!!

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro code to add Autofilter for all sheets except certain ones

    You're welcome. Glad to help out and thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to copy Code / Macro Code / 2 Sheets
    By paxile2k in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-23-2014, 12:59 AM
  2. [SOLVED] Macro Wanted to Set/Change AutoFilter Even If Sheets are Grouped
    By caddcop in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2014, 07:45 PM
  3. [SOLVED] Excel Macro Visual Basic code not looking at all sheets with second section of code.
    By Heinrich Venter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2014, 08:26 AM
  4. Autofilter Macro Failing - Run-time error 91 - full macro code is attached
    By evamarie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2013, 02:36 PM
  5. Macro code for autofilter past dates
    By piyushchadha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2013, 10:53 AM
  6. Simplify VBA code for autofilter from Macro recording
    By miners in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-27-2009, 09:58 PM
  7. [SOLVED] macro stops on "selection.autofilter" line of code
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-10-2005, 10:55 AM

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