View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Macro for multiple prints

Then this should do it.

Sub Button6_Click()
'
' Button6_Click Macro
' Macro recorded 03/08/2009 by
'
Sheets("Mark sheet").Select
Range("A1:H56").Select
Range("H56").Activate
numCpy = Range("G16").Value
Selection.PrintOut Copies:=numCpy, Collate:=True
Sheets("Input").Select
Range("A1").Select
End Sub




"Leporello" wrote in message
...
Thank you.

Your solution does work, but it creates a dialogue box which appears after
the macro has been called and requires a user input. The number of
copies,
together with various other information, has already been entered into the
sheet "Input", and I really want a way of taking the existing value from
the
"Input" sheet and using it directly to control the print operation.
Something like numCpy = Input!G16 but with the correct syntax to allow it
to
work!

"JLGWhiz" wrote:

This is one way:


Sub Button6_Click()
'
' Button6_Click Macro
' Macro recorded 03/08/2009 by
'
Sheets("Mark sheet").Select
Range("A1:H56").Select
Range("H56").Activate
numCpy = Application.InputBox("Enter number of Copies")
Selection.PrintOut Copies:=numCpy, Collate:=True
Sheets("Input").Select
Range("A1").Select
End Sub



"Leporello" wrote in message
...
I have a simple three sheet workbook which contains the macro below to
print
one part of one of the sheets. I wish to amend it to print several
copies,
depending on the user input in cell G16 of sheet "Input". Can I alter
the
Selection.Printout line of the macro or should I use a loop structure?
In
either case some help on the syntax would be appreciated.

Sub Button6_Click()
'
' Button6_Click Macro
' Macro recorded 03/08/2009 by
'
Sheets("Mark sheet").Select
Range("A1:H56").Select
Range("H56").Activate
Selection.PrintOut Copies:=1, Collate:=True
Sheets("Input").Select
Range("A1").Select
End Sub