close

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(quot;Sheet1quot;, quot;Sheet2quot;, quot;Sheet3quot;, quot;Sheet4quot;, _
quot;Sheet5quot;, quot;Sheet6quot;, quot;Sheet7quot;))
.PrintOut Copies:=1
End With

Thanks in advance

Hi Ant,
First up I'd add the 2 lines below to the start of your code amp; the
respective quot;truequot; 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):
www.rondebruin.nl/print.htm#visible

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

Sheets(Array(quot;Sheet1quot;, quot;Sheet3quot;)).PrintOut
'all sheets in the array
Hth
Rob Brockett
NZ
Always learning amp; the best way to learn is to experience...--
broro183
------------------------------------------------------------------------
broro183's Profile: www.excelforum.com/member.php...oamp;userid=30068
View this thread: www.excelforum.com/showthread...hreadid=526672

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()