Print Preview of Multiple worksheets

manojkumat

New Member
Joined
Dec 1, 2014
Messages
3
Hey, I want a macro to display print preview of multiple worksheets of an excel file. I've a macro that is basically displaying the preview of just one worksheet. But i want a macro that can display the preview of say 4-5 worksheets in a big excel file of say 30 worksheets.


The Macro I'm using currently is:


'Show the print preview window for a specific Excel worksheet


Worksheets("A1 - Final BS").PrintPreview
End Sub


Please help me with this problem.


Thanks in advance,
Manoj
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hello,

you haven't specified with sheets you wish to preview.

This code will preview all worksheets (tabs) in the workbook.

Code:
Sub PRINT_PREVIEW()
    For MY_SHEETS = 1 To ActiveWorkbook.Sheets.Count
        Sheets(MY_SHEETS).PrintPreview
    Next MY_SHEETS
End Sub
 
Upvote 0
Hi,

Thanks for your reply!

The tabs which i want to preview are:
1. A1 - Final BS
2. B1- Final IS
3. C1 - Final SMC
4. D1- Final Cash Flow
5. E1 - Final CSI

The other fact is these tabs are not in order, means there are other tabs which are in between these tabs and I don't want to change the given order of the tabs.

Could you please help modify the macro with these details.

Sorry! if i am asking too much but I'm not from this background and trying to learn writing macros.

Your help is appreciated.

Thanks,
Manoj
 
Upvote 0
Hello,

if the word FINAL is not in the tabs that you don't want to print then you can use this code

Code:
Sub PRINT_PREVIEW()
    For MY_SHEETS = 1 To ActiveWorkbook.Sheets.Count
        If UCase(Mid(Sheets(MY_SHEETS).Name, 6, 5)) = "FINAL" Then
            Sheets(MY_SHEETS).PrintPreview
        End If
    Next MY_SHEETS
End Sub

if FINAL is in any of the other tabs, then you will need to hard code each sheet name into the macro

Code:
Sub PRINT_PREVIEW()
    For MY_SHEETS = 1 To ActiveWorkbook.Sheets.Count
        If UCase(Mid(Sheets(MY_SHEETS).Name, 6, 5)) = "FINAL" Then
            Sheets(MY_SHEETS).PrintPreview
        End If
    Next MY_SHEETS
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,109
Messages
6,128,883
Members
449,477
Latest member
panjongshing

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