![]() |
Print sheets in order 'x' times
I have a workbook from which I need to print 15 worksheets. My macro works
fine to do this, however I now need to print more than one copy but would like them printed in order, i.e. page 1, page 2, page 3 etc 5 times rather than 5x page 1, 5x page2, etc. How do I add this in? And can I change the number printed each time? I'm a complete novice with VBA and my only knowledge is cannibalisation of existing macros, so simplicity would be appreciated!! Many thanks Kate |
Print sheets in order 'x' times
Without seeing your code that prints the 15 sheets it's a bit difficult to
answer. However, The code below will print x copies of each sheet in orde which you should be able to adapt. Sub mariner() numbertoprint = InputBox("How many copies of each") Dim sh As Worksheet For x = 1 To numbertoprint For Each sh In ThisWorkbook.Worksheets sh.Select ActiveSheet.PrintOut Next sh Next End Sub Mike "KateB" wrote: I have a workbook from which I need to print 15 worksheets. My macro works fine to do this, however I now need to print more than one copy but would like them printed in order, i.e. page 1, page 2, page 3 etc 5 times rather than 5x page 1, 5x page2, etc. How do I add this in? And can I change the number printed each time? I'm a complete novice with VBA and my only knowledge is cannibalisation of existing macros, so simplicity would be appreciated!! Many thanks Kate |
Print sheets in order 'x' times
Sub PrintSheets()
Dim x as Integer, Y as Integer x = InputBox("How many Copies?) For y = t to x Do 'Print one set y = y 6+ 1 Loop until y x End Sub -- Pops Jackson "KateB" wrote: I have a workbook from which I need to print 15 worksheets. My macro works fine to do this, however I now need to print more than one copy but would like them printed in order, i.e. page 1, page 2, page 3 etc 5 times rather than 5x page 1, 5x page2, etc. How do I add this in? And can I change the number printed each time? I'm a complete novice with VBA and my only knowledge is cannibalisation of existing macros, so simplicity would be appreciated!! Many thanks Kate |
Print sheets in order 'x' times
'TYPO!
'Should read For y = 1 to x Sorry. -- Pops Jackson "Pops Jackson" wrote: Sub PrintSheets() Dim x as Integer, Y as Integer x = InputBox("How many Copies?) For y = t to x Do 'Print one set y = y 6+ 1 Loop until y x End Sub -- Pops Jackson "KateB" wrote: I have a workbook from which I need to print 15 worksheets. My macro works fine to do this, however I now need to print more than one copy but would like them printed in order, i.e. page 1, page 2, page 3 etc 5 times rather than 5x page 1, 5x page2, etc. How do I add this in? And can I change the number printed each time? I'm a complete novice with VBA and my only knowledge is cannibalisation of existing macros, so simplicity would be appreciated!! Many thanks Kate |
Print sheets in order 'x' times
Another Typo!
y = y + 1 Sorry again. Is it Friday yet? -- Pops Jackson "Pops Jackson" wrote: Sub PrintSheets() Dim x as Integer, Y as Integer x = InputBox("How many Copies?) For y = t to x Do 'Print one set y = y 6+ 1 Loop until y x End Sub -- Pops Jackson "KateB" wrote: I have a workbook from which I need to print 15 worksheets. My macro works fine to do this, however I now need to print more than one copy but would like them printed in order, i.e. page 1, page 2, page 3 etc 5 times rather than 5x page 1, 5x page2, etc. How do I add this in? And can I change the number printed each time? I'm a complete novice with VBA and my only knowledge is cannibalisation of existing macros, so simplicity would be appreciated!! Many thanks Kate |
Print sheets in order 'x' times
mike:
it should work without selecting each sheet Sub mariner() Dim numbertoprint As Long, x As Long numbertoprint = InputBox("How many copies of each") Dim sh As Worksheet For x = 1 To numbertoprint For Each sh In ThisWorkbook.Worksheets sh.PrintPreview Next sh Next End Sub -- Gary "Mike H" wrote in message ... Without seeing your code that prints the 15 sheets it's a bit difficult to answer. However, The code below will print x copies of each sheet in orde which you should be able to adapt. Sub mariner() numbertoprint = InputBox("How many copies of each") Dim sh As Worksheet For x = 1 To numbertoprint For Each sh In ThisWorkbook.Worksheets sh.Select ActiveSheet.PrintOut Next sh Next End Sub Mike "KateB" wrote: I have a workbook from which I need to print 15 worksheets. My macro works fine to do this, however I now need to print more than one copy but would like them printed in order, i.e. page 1, page 2, page 3 etc 5 times rather than 5x page 1, 5x page2, etc. How do I add this in? And can I change the number printed each time? I'm a complete novice with VBA and my only knowledge is cannibalisation of existing macros, so simplicity would be appreciated!! Many thanks Kate |
Print sheets in order 'x' times
Thanks for the suggestions - for some reason I can't access the MS discussion
groups from work so will have to print it off and try it out tomorrow. I probably should have said that I am printing 15 worksheets out of about 28 - the others are raw data linking through. Thanks again! Kate "Pops Jackson" wrote: Another Typo! y = y + 1 Sorry again. Is it Friday yet? -- Pops Jackson "Pops Jackson" wrote: Sub PrintSheets() Dim x as Integer, Y as Integer x = InputBox("How many Copies?) For y = t to x Do 'Print one set y = y 6+ 1 Loop until y x End Sub -- Pops Jackson "KateB" wrote: I have a workbook from which I need to print 15 worksheets. My macro works fine to do this, however I now need to print more than one copy but would like them printed in order, i.e. page 1, page 2, page 3 etc 5 times rather than 5x page 1, 5x page2, etc. How do I add this in? And can I change the number printed each time? I'm a complete novice with VBA and my only knowledge is cannibalisation of existing macros, so simplicity would be appreciated!! Many thanks Kate |
All times are GMT +1. The time now is 08:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com