+ Reply to Thread
Results 1 to 6 of 6

Filtering out a long list making it Shorter and Faster!

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Timaru
    MS-Off Ver
    Excel 2003
    Posts
    15

    Filtering out a long list making it Shorter and Faster!

    HI

    I have a long repetitive code i have manage to get to work for me. I was wondering if there is a way of shortening this code to make it work faster? i know there has got to be a way. I am just a novice muddling my way through code and cannot seem to work it out.

    Thanks in advance!

    Please Login or Register  to view this content.
    Last edited by Miricleman; 06-28-2016 at 03:32 PM. Reason: not following title rules?

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Shorter Faster code NEEDED!!!!

    What is that code supposed to do.
    It looks like it just applies a bunch of filters and then removes them by .ShowAllData
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Shorter Faster code NEEDED!!!!

    The first thing I would do would be to see if there is a repeative pattern and you have quite a number where you use "Field:=5" for your autofiltering.

    I would then put all these different criteria values in a column and name this as say "List1". I would the add some lines to the macro:


    Please Login or Register  to view this content.
    So this macro part will loop through all values in "List1" and set autofilter to the appropriate cell value.

    Alf

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Shorter Faster code NEEDED!!!!

    i would combine the same fields into an array and filter all at once then delete

    Please Login or Register  to view this content.
    alternatively create a helper column to identify which rows require filter
    then filter on helper and delete only those in one go
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Shorter Faster code NEEDED!!!!

    I would remove al those yelling exclamation marks and capitals in the threadtitle first.



  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,596

    Re: Shorter Faster code NEEDED!!!!

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

+ 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. Use a shorter code
    By tax112 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-20-2015, 02:54 AM
  2. [SOLVED] How can I make this code shorter by using a loop. or there's any easier shorcuts code
    By romarkevinruiz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-10-2014, 08:53 AM
  3. Make VBA code shorter
    By juanrmz24 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2013, 12:11 PM
  4. [SOLVED] Trying to change verbose looping code into more efficient (and shorter) code please
    By dawatcher in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-03-2013, 07:43 AM
  5. making code shorter
    By hvalhund in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2011, 11:58 AM
  6. 2nd attempt ~ Faster/Shorter formula
    By Luke in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-15-2005, 12:35 PM
  7. [SOLVED] Need faster/shorter formula
    By Luke in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-10-2005, 12:15 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