+ Reply to Thread
Results 1 to 4 of 4

Apply Filter Across All Sheets with Blanks Omitted

Hybrid View

  1. #1
    Registered User
    Join Date
    08-01-2014
    Location
    Washington, D.C.
    MS-Off Ver
    2013
    Posts
    2

    Apply Filter Across All Sheets with Blanks Omitted

    I am looking to modify the below macro to apply a date filter across multiple worksheets. I would like to tweak the macro to possibly omit blank cells when the filter is applied. When applying the filter manually within the worksheet, there is a check box that is checked by default to include blanks. The same occurs by default when I run the below. The problem is that when I go to print the worksheet, the blank rows are also printed. If the blanks could be ignored by way of the macro filter, the print area would take care of itself. Thank you in advance for your help.

    Sub Filter()
    
        Dim ws As Object
        For Each ws In Worksheets
        ws.Range("$A$1:$G$1000").AutoFilter Field:=1, Criteria1:=Array( _
            "Date", "Postage Log", "="), Operator:=xlFilterValues, Criteria2:=Array(1, _
            "8/31/2014")
        Next ws
    End Sub
    Last edited by JBeaucaire; 08-01-2014 at 10:52 AM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Apply Filter Across All Sheets with Blanks Omitted

    Pretty sure it's the "=" you need to remove to skip blanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-01-2014
    Location
    Washington, D.C.
    MS-Off Ver
    2013
    Posts
    2

    Re: Apply Filter Across All Sheets with Blanks Omitted

    Yup, that was it. Don't I feel like a dummy Thanks!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Apply Filter Across All Sheets with Blanks Omitted

    As it appears you've reached a conclusion, I've marked this thread SOLVED for you.
    FYI, this is done through the Thread Tools located above the first post in this thread. Thanks.

+ 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 apply a filter from one sheet (a master sheet) to all sheets in workbook
    By SeaniGeld in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-30-2013, 02:00 PM
  2. advanced filter - button to re apply advanced filter across multiple sheets
    By motmac87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2013, 11:16 PM
  3. Replies: 4
    Last Post: 11-19-2012, 09:16 AM
  4. How do I apply a filter across multiple sheets
    By Dan1956 in forum Excel General
    Replies: 0
    Last Post: 08-07-2012, 09:33 AM
  5. Apply filter to two sheets and consolidate
    By humacdeep in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-26-2012, 05:00 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