Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sub PrintActiveSheet()
Dim ws As Worksheet: Set ws = ThisWorkbook.ActiveSheet
With ws.PageSetup
.Orientation = xlLandscape
.Zoom = False
.FitToPagesTall = 1
.FitToPagesWide = 1
.PrintArea = "B1:R41"
End With
End Sub
Copy link

vishwarajanand commented Sep 14, 2020

This was super helpful, thanks. ❤️
I changed
.PrintArea = "B1:R41"
to always set the current selection
.PrintArea = ActiveCell.CurrentRegion.Address


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment