Results 1 to 2 of 2

Auto-Update Macro breaks Filter View - Can I fix this?

Threaded View

  1. #1
    Registered User
    Join Date
    02-01-2024
    Location
    UK
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2312 Build 16.0.17126.20132) 32-bit
    Posts
    1

    Auto-Update Macro breaks Filter View - Can I fix this?

    Hi everyone, first time posting and also first time getting involved with Excel's VBA and Macros so I'm a little out of my depth!

    My aim for my workbook is as follows:
    • When a Quote has been sent, someone will add the date in the 'Done' column.
    • This will then automatically get sent to a different sheet, so that all of the customers with the quotes sent are in one place.
    • The customers for which the Quote has been sent will then be
    • filtered out, so that it makes it easier to see what is still to do.

    To achieve this, I have:
    1. Set up a macro to, using advanced filtering, check for content in the 'Done' column. If there is something there, it will copy that to a different sheet.
    2. Set up a macro to automatically refresh the workbook whenever anything is typed, so that the book is constantly sending finished quotes to the other sheet.
    3. Set up a view with a filter that hides a customer UNLESS their 'Done' column is empty.

    Because of the way advanced filtering works, the view has to be toggle-able so that additional information can still be entered into the sheet after a quote has been done. I initially had the auto-refresh macro also apply the filter to hide 'Done' quotes, however realised this made it impossible to change any of these entries.

    My problem is that every time the workbook refreshes, it turns off the filter for hiding 'Done' quotes. This means the view is useless and doesn't actually differ from the Default view.
    I am making this workbook for my colleagues who are less adept in Excel than me, so having them manually reapply the filter each time is not ideal and so I am trying to find another solution.

    I have made a macro to apply the filter, but ideally this would happen automatically, however ONLY when using a specific view.
    Is there a way for VBA to first check the view before applying the filter?

    My macros are as follows:

    Sub Update_Spreadsheet()
    '
    ' Update_Spreadsheet Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+J
    '
        Sheets("To Do").Range("Table1[#All]").AdvancedFilter Action:=xlFilterCopy, _
            CriteriaRange:=Sheets("Macro Rules").Range("A2:A3"), CopyToRange:=Range( _
            "Table13[#All]"), Unique:=False
        Sheets("To Do").ListObjects("Table1").Range.AutoFilter Field:=6, Criteria1:="="
    End Sub
    Sub Fix_View()
    '
    ' Fix_View Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+L
    '
        Selection.AutoFilter
        ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=6, Criteria1:="="
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Auto filter update
    By Roydemooij in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-22-2022, 03:38 AM
  2. Assigning pivot filter that doesn't exist breaks macro
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2017, 06:22 PM
  3. Replies: 2
    Last Post: 12-01-2015, 01:08 AM
  4. Auto Filter and how to have it auto update
    By Diva502 in forum Excel General
    Replies: 3
    Last Post: 04-22-2013, 12:18 AM
  5. Pivot Filter Macro - Auto Update to select previous 30 days.
    By rocksolid77 in forum Excel General
    Replies: 2
    Last Post: 11-26-2012, 01:46 PM
  6. Macro or VBA Help needed for Advanced Filter and auto update destination workbooks
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2012, 06:07 PM
  7. Delete a Row from auto filter view in excel 2007
    By ramu2k06 in forum Excel General
    Replies: 3
    Last Post: 05-18-2010, 07:08 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