+ Reply to Thread
Results 1 to 3 of 3

Format to Print or copy and paste formats?

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Format to Print or copy and paste formats?

    Greetings, Gurus.

    Which is faster in VBA, formatting a sheet to print, or copying the formats from an existing sheet and pasting the formats?

    Example: I have a rather long routine in one of my macros that formats the sheet for printing, (adjusting column widths, setting print area, etc.), as well as applying some number formats to some of the cells. Would it be quicker to have a mirror sheet in my "master" workbook, and simply copy and paste those formats to the new sheet?

    Thanks in advance.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon hutch@edge.net

    For some reason VBA is somewhat sluggish when it comes to manipulating print settings, the quickest way I've found relies on user intervention : select (programatically) all sheets, then open the print settings window and make any changes. Once the user presses enter (or clicks OK) the settings will be applied to all sheets (in tests I've done) around 92% quicker - a considerable time saving, but it relies on user intervention.

    Oddly enough, VBA's predecessor wasn't quite so slouchy performing these types of tasks and can still be accessed. There are a couple of articles here that discuss those techniques :
    http://groups.google.com/group/micro...c725d0d5a6b3d0
    http://www.mcgimpsey.com/excel/udfs/pagesetup.html

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706
    Thanks for the reply, Dominic.

    Requiring user input isn't an option, as I have multiple users running this macro, and the less interention the better.

    I'll study the possibility of using an Excel 4 macro, and also do some time trials to see if it's any quicker to paste the formats.

    Thanks.

+ 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: 13
    Last Post: 12-04-2012, 07:54 PM
  2. speed - variables vs copy paste
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2008, 03:34 PM
  3. question on copy and paste
    By jorgefherrero in forum Excel General
    Replies: 3
    Last Post: 04-10-2008, 10:00 AM
  4. VBA Code needed to copy and paste the format
    By deepikabalaji in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2007, 05:15 AM
  5. Conditional Copy Paste function
    By adotsey in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-21-2007, 05:16 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