+ Reply to Thread
Results 1 to 2 of 2

Print Array for hidden sheets using VBA

Hybrid View

  1. #1
    Ant
    Guest

    Print Array for hidden sheets using VBA

    Is it possible to print multiple hidden sheets using the array function in
    VBA? Currently my code opens them all up, prints, then closes them. However
    this is quite slow and I don't really need, or want, to see the sheets.
    Something like...

    With Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", _
    "Sheet5", "Sheet6", "Sheet7"))
    .PrintOut Copies:=1
    End With

    Thanks in advance



  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi Ant,
    First up I'd add the 2 lines below to the start of your code & the respective "true" lines after your code:
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False

    If this doesn't help/speed it up enough, have a look at Ron Debruin's page (I don't know how fast this technique is, as I have no printer at home):
    http://www.rondebruin.nl/print.htm#visible

    Ron shows the use of an array in the "one liner code" near the base of his page which suggests you were very close/have the solution. He doesn't use a "with" construct (see below) but I don't know if it would work on hidden sheets:

    Sheets(Array("Sheet1", "Sheet3")).PrintOut
    'all sheets in the array



    Hth
    Rob Brockett
    NZ
    Always learning & the best way to learn is to experience...

+ 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