+ Reply to Thread
Results 1 to 2 of 2

Speed-up Macro

  1. #1
    Forum Contributor
    Join Date
    10-28-2009
    Location
    Portland, Maine
    MS-Off Ver
    Excel 2003
    Posts
    102

    Speed-up Macro

    Looking for help optimizing a program. The program prints a dashboard and allows the end user to pick the range with a message box, specify number of printouts and print preview (yes or no).

    The program does precisely what I want it to do; however, it does it extremely slowly.

    Specifically there are two things that seem to be slowing it down 1) setting the header/footer and 2) setting the active sheet properties. Each of these steps is taking about 5 full seconds to run. >10 seconds to run a print macro is just too long!

    The full code is:
    Please Login or Register  to view this content.
    If I remove:
    Please Login or Register  to view this content.
    and:
    Please Login or Register  to view this content.
    The program is fast as expected.

    Any thoughts on how I can change or modify this so it's not so slow but still allows me to set the header/footer and active sheet properties?

    Any help is appreciated.
    Thanks!!!

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Speed-up Macro

    One thing...

    Do you need to set the footer every time?

    Replace:
    Please Login or Register  to view this content.

    with:
    Please Login or Register  to view this content.
    That won't really speed things up, but it does open the posibility of creating a "header" out of your top row. Then set the "Print Titles" setting to that row, so that those cell values appear at the top of each page.

    This will eliminate 5 seconds. You could even hide the first row until it comes time to print, and then just unhide the row to print, then hide it again at the end of the sub.

    You could also merge the two sections, though I don't know how much time this will save. I suspect at least some.

    Please Login or Register  to view this content.
    Last edited by Whizbang; 06-22-2011 at 04:07 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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