+ Reply to Thread
Results 1 to 6 of 6

Use VBA to set worksheet formatting

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,166

    Use VBA to set worksheet formatting

    I started this macro from macro recorder but it takes a very long time.
    Is there something to do to speed it up?
    Please Login or Register  to view this content.
    Any hints, tips or examples are appreciated.
    Last edited by Rick_Stanich; 11-29-2010 at 10:33 AM.
    Regards

    Rick
    Win10, Office 365

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

    Re: Use VBA to set worksheet formatting

    try this way:

    Please Login or Register  to view this content.
    Some parameters are as you would like to have as default value so no need to change - the way to speed it up
    Last edited by watersev; 11-29-2010 at 10:30 AM.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,565

    Re: Use VBA to set worksheet formatting

    Configuring the Printer settings was always very slow, in my experience ... and you're going through the process three times. It also used to depend on the printer driver, though it's a while since I've tried this so it might have improved

    If all the pages are (roughly) the same, try grouping the sheets and recording the macro as you set the parameters once for all the pages. Having recorded the macro, edit it to remove any default settings

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,263

    Re: Use VBA to set worksheet formatting

    PageSetup (before XL2010) is notoriously slow due to the communication between VBA and the printer drivers. You should either try to format the sheets ahead of time (e.g. use a template sheet) or use the old XLM PAGE.SETUP method:
    Please Login or Register  to view this content.
    Note that you need to activate each sheet when using this.
    Remember what the dormouse said
    Feed your head

  5. #5
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,166

    Re: Use VBA to set worksheet formatting

    Thanks for the help and tips!

  6. #6
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: Use VBA to set worksheet formatting

    Hi

    This has been a pain for some time, however you can speed it up using the Excel 4 macro function.

    Here are a couple of links explaining how to go about it.

    http://www.mcgimpsey.com/excel/udfs/pagesetup.html
    http://www.pcreview.co.uk/forums/thread-947330.php

    Regards

    Jeff

+ 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