+ Reply to Thread
Results 1 to 20 of 20

Filter not Clearing after deleting visible Rows

  1. #1
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Question Filter not Clearing after deleting visible Rows

    Hello, I am having an issue where this macro does not reset an autofilter after rows have been deleted. I am more than sure its a coder error as most of the routines in this code are snips taken from several sources. I have bolded the area of the code that appears to be failing. in addition to this I would like to apply a sort function to Column F on this sheet (after columns have been deleted). the code is below.

    Please Login or Register  to view this content.

    Please advise if you need any more info /clarification or if there are any other tips to clean up code make it run more effectively - I'm all ears

    :D
    Last edited by AliGW; 09-10-2024 at 04:31 AM. Reason: Code tags added - please review the forum guidelines.

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,622

    Re: Filter not Clearing after deleting visible Rows

    The line with On Error Resume Next means that you aren't notified of any error associated with subsequent lines.


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    Attachment 878661

    i get this error when i comment out the resume line



    thank you for your response

  4. #4
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,622

    Re: Filter not Clearing after deleting visible Rows

    Can't access the attachment. Are you able to upload a file?

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,839

    Re: Filter not Clearing after deleting visible Rows

    It looks like you made the data into a Table in which case you should be using:

    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  6. #6
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    that seemed to work - thank you all :D

  7. #7
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    We have reports from several users that the processing on this takes "forever". Does anyone have any tips / examples on how I would speed up the processing on large data sets ? thank you in advance for all your assistance.

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,484

    Re: Filter not Clearing after deleting visible Rows

    Start by uploading a sample file that depicts actual file setup and I am certain that someone will be able to offer an alternative that could be faster...
    Also, explain in detail what it is you are actually wanting to achieve...
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  9. #9
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    ok will have to redact/update some data in the file sets but I can upload when i get that done. Thank you again.

  10. #10
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Question Re: Filter not Clearing after deleting visible Rows

    Here is the way the file should work

    Paste the contents of the whole Order Data file into the Table Data Tab of Producev2 (Color added to Pasted Data to explain where data should be removed / updated. )
    Click on the Format Button
    Macro should do this to the pasted data.
    Step 1 : Clear Contents on the first 5 Rows (Peach Color)
    Step 2 : Delete rows with NA (Light Green Color)
    Step 3 : Delete Columns that are in Blue
    Step 4 : Delete the "#/" from the Seq # Column (In Pale Red)
    Step 5 : Format the data from the Seq # Column as a 4 digit # (In Pale Red)

    Nice to haves
    A clear all button that clears contents and formatting on all three tabs

    Main pain Point:
    Users are complaining of time to format and locking up excel sessions for 25-30 mins.


    Thank you for any assistance / ideas you may have for me.Producev2.xlsmCode.txtOrders-Result.xlsm

  11. #11
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,484

    Re: Filter not Clearing after deleting visible Rows

    Let me start by....
    Paste the contents of the whole Order Data file into the Table Data Tab of Producev2
    If that is the first step...Is both workbooks open?
    If so...I will immediately only extract the required columns to pass to the Produce book...ignoring the first 5 rows too...and then do the rest...
    The other steps 4 & 5 should take less than a second...

    What am I missing...
    Last edited by Sintek; 09-29-2024 at 02:54 PM.

  12. #12
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    we can keep the workbook open if that helps with processing that you are visioning, the file is downloaded daily but has the same Name "Order-Result.csv" as of right now it is taking between 30-45 mins to extract the data from the data source todays source had 151485 lines with 1/2 being the NA ones that we are deleting.

    after commenting out the code in sections of execution it appears that the code that has the most impact time wise is:

    Please Login or Register  to view this content.
    Hopefully this helps and thank you
    Last edited by AliGW; 09-30-2024 at 03:04 AM. Reason: Please don't quote unnecessarily - use the Quick Reply button instead. Please review the forum guidelines.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2501 (Windows 11 24H2 64-bit)
    Posts
    89,072

    Re: Filter not Clearing after deleting visible Rows

    Administrative Note:

    We would very much like to help you with your query, however we recommend that you include code tags around your code. I have done this for you TWICE in this thread - please do it yourself in future. Thanks.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  14. #14
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    my apologies, will include code wrapper on all future communication - thank you for bringing this to my attention :D

  15. #15
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,484

    Re: Filter not Clearing after deleting visible Rows

    So...As per your delete columns code...it seems to me the only columns you actually want to remain is...

    Destination # Item # Item Description Order Quantity (WHPK) Effective Release Date Seq Nbr/Route Nbr
    i.e Columns 7,8,9,12,21,28
    Is that correct?
    If so...this should be a bit faster...Both workbooks must be open...
    Code in producev2 book
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sintek; 09-30-2024 at 05:04 AM.

  16. #16
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    worked like a charm - thank you all :D

  17. #17
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,484

    Re: Filter not Clearing after deleting visible Rows

    Happy to have contributed...

  18. #18
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    I have another question / issue with a different Macro within this same project, would it be more appropriate to start a new thread or just continue within this one ?

  19. #19
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,484

    Re: Filter not Clearing after deleting visible Rows

    a different Macro within this same project
    Best to open a new thread as it does not pertain to the issue raised in this one...Please remember to mark as solved...Tx

  20. #20
    Registered User
    Join Date
    05-13-2024
    Location
    Reno,nv
    MS-Off Ver
    365
    Posts
    13

    Re: Filter not Clearing after deleting visible Rows

    will do - thank you

+ 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] Deleting visible rows depending upon criteria
    By jimpatel1993 in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 08-05-2021, 06:13 AM
  2. Replies: 1
    Last Post: 03-07-2021, 10:36 AM
  3. Combo box to select filter criteria, Filtering, Deleting visible cells
    By coryjacques in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2018, 03:28 PM
  4. [SOLVED] Clearing Data (not deleting rows) after date is in the past
    By jlo33 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-13-2013, 03:35 AM
  5. Autofilter - Delete Visible Rows without deleting the header row
    By easty in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2010, 06:14 AM
  6. Clearing cells and deleting rows based on condition
    By vijay2482 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2010, 10:08 AM
  7. Macro Help for Deleting Blank Rows & Clearing Cell Contents
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2006, 01:25 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