+ Reply to Thread
Results 1 to 5 of 5

Clear Filtered Data From Autofilter Result on Table

  1. #1
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Clear Filtered Data From Autofilter Result on Table

    Hello,

    I'm looking for ways to speed up my macro that runs repeated autofilter. It takes the contents and moves them to a different sheet based on that result, then on to the next one, and on and on. It was taking anywhere from 10-30 minutes to run each autofilter.

    Here is an example of one. Nothing special really.

    Please Login or Register  to view this content.
    I found that putting the data into a table first speeds up the autofilter by a HUGE margin. The bottleneck at this point is now removing the filtered data from the master sheet.

    Before, I was deleting the actual rows and while it worked, it takes awhile and I'm looking to make this as quick as possible since its only a small portion of a rather large series of events.

    The next thought was to leave the table intact and simply clear the cells of data so the table structure doesn't change. But... I can't seem to clear the contents with
    Please Login or Register  to view this content.
    Any suggestions?

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Clear Filtered Data From Autofilter Result on Table

    Possibly...
    Please Login or Register  to view this content.
    and if it's really needed, place this after the paste line
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Re: Clear Filtered Data From Autofilter Result on Table

    Deleting the rows unfortunately takes too long which is why I'm trying to clear the cell contents instead.

    Sorry, I'm not following how stating range.autofilter on its own would remove the contents of the cells though? calling the range.autofilter would just turn it off which in turn no longer has the filtered data selected.
    Last edited by Vlad717; 07-19-2019 at 08:28 PM.

  4. #4
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Re: Clear Filtered Data From Autofilter Result on Table

    Oh I'm a complete dummy. It works perfectly fine.

    My problem stems from this
    Please Login or Register  to view this content.
    I initially had this to find the visible cells in column A and delete the entire row of those visible cells.

    Now when I changed it to just clear contents I forgot to update the range from A:A to A:BP. So using specialcells(xlcelltypevisible).clearcontents works perfectly fine in a table! Doh

  5. #5
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Clear Filtered Data From Autofilter Result on Table

    Happens to us all sometime...

+ 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. [SOLVED] Macro to Autofilter a table and delete filtered rows: Error 1004 cannot alter table
    By brytsyt in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-05-2018, 04:57 AM
  2. Cell reference to filtered data auto update as Filtered result changes
    By Irajoo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-22-2017, 02:17 AM
  3. [SOLVED] Clear contents of every second row from filtered data
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2017, 06:59 AM
  4. clear entier cells on filtered data
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2016, 03:12 PM
  5. Replies: 1
    Last Post: 06-21-2013, 04:05 AM
  6. How to use If statement with data that is filtered using AutoFilter?
    By fbarbie in forum Excel Formulas & Functions
    Replies: 23
    Last Post: 06-22-2010, 06:50 PM
  7. Populating a table with filtered result of another table
    By pikakathy in forum Excel General
    Replies: 7
    Last Post: 01-10-2006, 08:04 PM

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