Print Range Macro

Hi,
I would like to use a macro to cycle through multiple tabs in a workbook and setup the print range.  I want  each tab to be a page and all contents to fit on one page in landscape on a standard 8.5 by 11 page.  

Thanks
Montrof
LVL 1
montrofAsked:
Who is Participating?
 
Michael VasilevskySolutions ArchitectCommented:
Please try this modification:

    Dim ws As Worksheet
    
    For Each ws In ActiveWorkbook.Worksheets
        With ws.PageSetup
            .Orientation = xlLandscape
            .Zoom = False
            .FitToPagesWide = 1
            .FitToPagesTall = 1
        End With
        
        On Error Resume Next
    Next ws

Open in new window

0
 
Michael VasilevskySolutions ArchitectCommented:
Try this code:

Sub MyMacro
    Dim ws As Worksheet
    
    For Each ws In ActiveWorkbook.Worksheets
        With ws.PageSetup
            .Orientation = xlLandscape
            .FitToPagesWide = 1
            .FitToPagesTall = 1
        End With
        
        On Error Resume Next
    Next ws
    
End Sub

Open in new window

0
 
nutschCommented:
Try this on your selected sheets

Sub Macro1()
'
' Macro1 Macro
'
Dim sht As Worksheet

Application.PrintCommunication = False

For Each sht In ActiveWindow.SelectedSheets
    
    With sht.PageSetup
        .Orientation = xlLandscape
        .PaperSize = xlPaperLetter
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    
Next sht

Application.PrintCommunication = True
End Sub

Open in new window


Thomas
0
 
montrofAuthor Commented:
Thank you for the Macros but neither work, Each tab is still showing mutiple pages. I do not know if it maters but there are graphs on the tabs.
0
 
montrofAuthor Commented:
Perfect thank you so much for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.