ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   UserForm Print Extra Copies (https://www.excelbanter.com/excel-discussion-misc-queries/44578-userform-print-extra-copies.html)

mully

UserForm Print Extra Copies
 
Hi

On a user form I have a command button "Print1" which on clicking uses the
following macro to print the sheet

Sub Macro4()

Sheets("Print1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

What would I need to add so that on clicking the command button it would ask
how many copies required.

Any help much appreciated

Cheers Mully

David Hepner


Try this:

Dim x As Integer
x = InputBox("Number of copies?", "Print")
If x 0 Then
ActiveWindow.SelectedSheets.PrintOut Copies:=x, Collate:=True
Else

End If

or you could use this:

Application.Dialogs(xlDialogPrinterSetup).Show


"mully" wrote:

Hi

On a user form I have a command button "Print1" which on clicking uses the
following macro to print the sheet

Sub Macro4()

Sheets("Print1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

What would I need to add so that on clicking the command button it would ask
how many copies required.

Any help much appreciated

Cheers Mully


mully

Hi David

Thanks it worked perfectly 1st time of trying -- just one query is it
possible within the dialog box to tell it which sheet to print in the
workbook e.g. 10 copies of
"Sheet 3" and then after finishing the print run open the dialog box again 5
copies
"Sheet4"

Once again thanks for all your help.

Cheers Mully

"David Hepner" wrote:


Try this:

Dim x As Integer
x = InputBox("Number of copies?", "Print")
If x 0 Then
ActiveWindow.SelectedSheets.PrintOut Copies:=x, Collate:=True
Else

End If

or you could use this:

Application.Dialogs(xlDialogPrinterSetup).Show


"mully" wrote:

Hi

On a user form I have a command button "Print1" which on clicking uses the
following macro to print the sheet

Sub Macro4()

Sheets("Print1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub

What would I need to add so that on clicking the command button it would ask
how many copies required.

Any help much appreciated

Cheers Mully



All times are GMT +1. The time now is 03:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com