+ Reply to Thread
Results 1 to 5 of 5

Slow Code, Can it be improved on?

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Slow Code, Can it be improved on?

    Again, I'm still learning and reading some books so the below may not be the best approach or perhaps there is a way to speed it up.

    The below is to hide and unhide various rows and columns based on a cell value of "Yes" or "No". And I've found the macro may take upwards of 20 seconds to run some times and unsure if it can be improved on.

    I did abbreviate/shorten the below to post. But the macro searches various select ranges from A1 to about cell FF300. The word "Yes" and "No" could also be in other parts of the spreadsheet as well, thus I am searching the various specific ranges.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Slow Code, Can it be improved on?

    hi ptmuldoon, try sort of that

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Slow Code, Can it be improved on?

    Thanks, but I think that did not quite do exactly the same thing. The original code is hiding either entire rows or entire columns depending on what a Cell says in that row or column.

    I think your code just tried to hide all the columns where a yes was found. I will play with it some more tonight as well. Hopefully we can work to speed up the macro to hide them faster.

    Your code is beyond my current skill set. But I will try and digest it and see what I can learn.
    Last edited by ptmuldoon; 07-23-2014 at 03:12 PM.

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Slow Code, Can it be improved on?

    I did miss that point, then it might be done this way:

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Slow Code, Can it be improved on?

    A HUGE thanks. The code seems to work perfectly and I'm adding in the rest of ranges needed.

    And it WAY faster. And the code is called when the file opens as well, so was important to try and get it run quicker.

+ 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. Why is this code so slow?
    By cmmercer in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-25-2014, 06:32 AM
  2. [SOLVED] Vba code makes workboos slow. Any alternate code ??
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-23-2014, 04:30 AM
  3. can this code be improved
    By rjhe22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2013, 10:02 AM
  4. Improved: select all code with one click
    By mahju in forum The Water Cooler
    Replies: 0
    Last Post: 04-15-2012, 09:39 AM
  5. Replies: 1
    Last Post: 04-09-2012, 11:22 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