Print Formula

spilner

Board Regular
Joined
Jun 7, 2011
Messages
146
Hi, ive thousand of sheets. How do i print range of sheets. My sheets is named as numbers and the sheets is randomly, not sorted.
How do i print from this sheet example from sheet 80 to sheet 500.
So it will print everything from 80 to sheet 500.
This Mean within 80 to sheet 500 probably have this sheet number 700,800 etc.
Atm i need to select all sheets i want and print it.
Hope someone can help me. Thanks a lot guys.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Something like this maybe:

Code:
Sub PrintBasedOnColor()
'Prints the yellow tabs
Dim x As Worksheet
'6=Yellow
'3=Red
'5=Blue
    For Each x In ActiveWorkbook.Sheets
        If x.Tab.ColorIndex = 6 Then x.PrintOut
    Next x
End Sub
 
 
Sub PrintBasedOnName()
'Prints sheets named '10' to '13' inclusive
Dim x As Worksheet
    For Each x In ActiveWorkbook.Sheets
        If IsNumeric(x.Name) Then
            If x.Name >= 10 And x.Name <= 13 Then x.PrintOut
        End If
    Next x
End Sub
 
Upvote 0
How do i print range of sheets. My sheets is named as numbers and the sheets is randomly, not sorted.
How do i print from this sheet example from sheet 80 to sheet 500.
So it will print everything from 80 to sheet 500.
This Mean within 80 to sheet 500 probably have this sheet number 700,800 etc.
See if this is what you mean.

<font face=Courier New><br><SPAN style="color:#00007F">Sub</SPAN> PrintSheetRange()<br>    <SPAN style="color:#00007F">Dim</SPAN> i <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>    <br>    <SPAN style="color:#00007F">Const</SPAN> FirstSh <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN> = "80"<br>    <SPAN style="color:#00007F">Const</SPAN> LastSh <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN> = "500"<br>    <br>    <SPAN style="color:#00007F">For</SPAN> i = Sheets(FirstSh).Index <SPAN style="color:#00007F">To</SPAN> Sheets(LastSh).Index<br>        Sheets(i).PrintOut<br>    <SPAN style="color:#00007F">Next</SPAN> i<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br></FONT>
 
Upvote 0
Ill let u know when i try this at work tomorrow. Ive 2 printers and want to print different color at different printers. Will the code let me choose the printers?
My boss just mad at me when i miss print some of documents :(
Hope this code work perfect and print all without miss any.
Thanks a lot formR. If anyone got any good vba, feel free to post it here. Thank u so much.
 
Upvote 0
both formula works perfect.thanks a lot peter & formr.
Glad it worked for you. Note that what was suggested was not a "formula" but a "macro" or "vba code". If you use the correct terminology, you will get better responses. :)
 
Upvote 0
for the print code.can u make the code print it without it go to each sheet and print it?
i want it done fast cause ive other range to print.can u fix it?
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top