Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for multiple prints
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for multiple prints
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 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for multiple prints
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 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for multiple prints
Thankk you, that was the information I needed to make it work.
"JLGWhiz" wrote: 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 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I keep heading so it prints on multiple pages | Excel Discussion (Misc queries) | |||
when printing multiple sheets, first prints single side rest doub. | Setting up and Configuration of Excel | |||
½ symbol prints a 2 and Winding square box prints a F | Excel Discussion (Misc queries) | |||
multiple prints in Excel | Excel Discussion (Misc queries) | |||
macro only prints out first and last line of document | Excel Programming |