+ Reply to Thread
Results 1 to 7 of 7

VBA is too slow, need a quicker solution

  1. #1
    Registered User
    Join Date
    10-27-2017
    Location
    Grand Island, Nebraska
    MS-Off Ver
    2016
    Posts
    3

    VBA is too slow, need a quicker solution

    This VBA runs exactly as i need it to but it slows down my workbook too much. Is there a better way to accomplish this?

    Please Login or Register  to view this content.
    It continues on as well
    Last edited by Glenn Kennedy; 12-11-2020 at 01:16 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: VBA is too slow, need a quicker solution

    Administrative Note:

    Welcome to the forum.



    Please see Forum Rule #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

    Since you are an infrequent user, I have done it for you... this time. You can expect further incidences to result in your thread being BLOCKED until you do it yourself.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    04-12-2011
    Location
    Bay Lake, FL
    MS-Off Ver
    Excel 2016 / 365
    Posts
    66

    Re: VBA is too slow, need a quicker solution

    To start with, I'd try combining some of the statements - you're doing a lot of checks to see if A5 equals "". You also don't need to specify ElseIf for the opposite.

    Please Login or Register  to view this content.
    How many rows are in your document?

  4. #4
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: VBA is too slow, need a quicker solution

    The main problem is the macro started every change on the worksheet i mean. Please attache an exemple.
    Last edited by BMV; 12-11-2020 at 02:23 PM.

  5. #5
    Registered User
    Join Date
    04-12-2011
    Location
    Bay Lake, FL
    MS-Off Ver
    Excel 2016 / 365
    Posts
    66

    Re: VBA is too slow, need a quicker solution

    Quote Originally Posted by BMV View Post
    The main problem the macro started every change on the worksheet.
    That's also a good point. Ideally, you'd only trigger the macro if A5 (or one of the other cells mentioned) changed, not every single time any cell on the sheet changed.

  6. #6
    Registered User
    Join Date
    10-27-2017
    Location
    Grand Island, Nebraska
    MS-Off Ver
    2016
    Posts
    3

    Re: VBA is too slow, need a quicker solution

    Right now there are 200 rows in this worksheet but may increase to 250 or more

  7. #7
    Registered User
    Join Date
    10-27-2017
    Location
    Grand Island, Nebraska
    MS-Off Ver
    2016
    Posts
    3

    Re: VBA is too slow, need a quicker solution

    I combined the statements which helped a little. Ultimately I added...

    At the beginning

    Please Login or Register  to view this content.
    At the end

    Please Login or Register  to view this content.
    It's no longer slow. Thanks for the help!

+ 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. Replies: 3
    Last Post: 07-04-2019, 08:34 AM
  2. Index Match too slow, is there a VBA solution?
    By Annie88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2018, 12:59 PM
  3. [SOLVED] Excel VBA: Lisbox search very very slow - Ist there a quicker method?
    By Narozsnikz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-06-2018, 07:03 AM
  4. Delete Row if value less than - Quicker Solution?
    By batchy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-27-2017, 08:45 PM
  5. Cause and solution of slow execution of VBA!
    By meus in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-14-2015, 01:30 AM
  6. VBA - Hide Row - Slow Code - How to make it quicker?
    By bartzak in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-10-2013, 11:22 PM
  7. If, Then statements w/mult criteria & data - calcs far too slow. Quicker Method?
    By Samstan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2011, 10:42 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