+ Reply to Thread
Results 1 to 3 of 3

How to Speed up my macro

  1. #1
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    How to Speed up my macro

    I am trying to speed up my macro because it ends up taking 15 or 20 seconds. Here is my code and here is my worksheet as well. Inventory Management Speedy.xlsm
    I think it could be because of the index functions in the code. I received some help on that part on another thread so I don't know how to change it very well. For some reason my code also triggers another private sub macro on the Print Label's tab when I step through it. Any idea how to stop that from happening?

    This code is for the tab "Transaction".

    Please Login or Register  to view this content.
    Last edited by manofcheese; 06-09-2014 at 08:15 PM.

  2. #2
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: How to Speed up my macro

    I played around with it a little and this is my new code. It still isn't as fast as I would like. Any suggestions?
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    08-06-2013
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2013
    Posts
    671

    Re: How to Speed up my macro

    I have a couple ideas for you. First, loops are slow. If you can avoid a loop, do. Avoiding loops If you can't, take as much out of the loop as possible. There is no reason you need to be declaring variables, changing the calculation settings, etc inside the loop.
    Second, writing to cells is slow. You want to write as few times as possible. For some reason, excel can write to 100,000 cells faster than it can write to a single cell 100 times. I'd create an array to store your values in, instead of changing cell values, then paste the whole array down at the end.
    1. Include a sample workbook with an example of the result you want
    2. Use [CODE] and [FORMULA] wrappers for your VBA code or excel formulas
    3. If your question has been answered, mark the thread as SOLVED and click on the "Add Rep" star to thank whoever helped 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. Could someone help me speed up this macro?
    By Michael D in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-01-2014, 09:00 AM
  2. [SOLVED] How To Speed up macro
    By AnkitGuru in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-02-2012, 06:36 AM
  3. Speed-up Macro
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2011, 04:04 PM
  4. [SOLVED] Speed up a macro
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-17-2010, 05:05 PM
  5. Speed up macro
    By Duncan1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-03-2007, 09:46 PM

Tags for this Thread

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