Macro to print 2 copies of active page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to create a macro that will print 2 copies of an active worksheet(s) in a workbook. The shortcut key has already been assigned as CTRL+Z. This one has me stumped. Sure would appreciate any help!
 
try
Activesheet.printout copies:=2

--
Don Guillett
SalesAid Software
(e-mail address removed)
Larry said:
I'm trying to create a macro that will print 2 copies of an active
worksheet(s) in a workbook. The shortcut key has already been assigned as
CTRL+Z. This one has me stumped. Sure would appreciate any help!
 
Try this Larry

ActiveSheet.PrintOut Copies:=2


--
Regards Ron de Bruin
http://www.rondebruin.nl


Larry said:
I'm trying to create a macro that will print 2 copies of an active worksheet(s) in a workbook. The shortcut key has already been
assigned as CTRL+Z. This one has me stumped. Sure would appreciate any help!
 
That's exactly what Ron and I gave you when we said ACTIVESHEET. It will
print the active sheet..... There must be more to your macro.

--
Don Guillett
SalesAid Software
(e-mail address removed)
Larry said:
Thanks! The macro will print 2 copies when CTRl+Z is pressed. One
problem, which I neglected to mention, there are 4 pages in the worksheet in
this workbook (each subsequent page is a duplicate of the first page). The
macro you suggested prints 2 copies of each page for a total of 8 pages. My
questions is: how do I modify the macro you gave me to print only the active
page(s) in the active worksheet? Thanks again for your expertise.
 
This is possible but it is not fast.
Tru something like this

Sub PrintCurrentPage()
Dim VPC As Integer, HPC As Integer
Dim VPB As VPageBreak, HPB As HPageBreak
Dim NumPage As Integer

If ActiveSheet.PageSetup.Order = xlDownThenOver Then
HPC = ActiveSheet.HPageBreaks.Count + 1
VPC = 1
Else
VPC = ActiveSheet.VPageBreaks.Count + 1
HPC = 1
End If
NumPage = 1
For Each VPB In ActiveSheet.VPageBreaks
If VPB.Location.Column > ActiveCell.Column Then Exit For
NumPage = NumPage + HPC
Next VPB
For Each HPB In ActiveSheet.HPageBreaks
If HPB.Location.Row > ActiveCell.Row Then Exit For
NumPage = NumPage + VPC
Next HPB
'MsgBox "Page number of the active cell = " & NumPage
ActiveWindow.SelectedSheets.PrintOut _
From:=NumPage, To:=NumPage, _
Copies:=2, Collate:=True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


Larry said:
Thanks! The macro will print 2 copies when CTRl+Z is pressed. One problem, which I neglected to mention, there are 4 pages in
the worksheet in this workbook (each subsequent page is a duplicate of the first page). The macro you suggested prints 2 copies of
each page for a total of 8 pages. My questions is: how do I modify the macro you gave me to print only the active page(s) in the
active worksheet? Thanks again for your expertise.
 
Back
Top