jolivanes
Well-known Member
- Joined
- Sep 5, 2004
- Messages
- 3,140
- Office Version
- 2013
- 2007
- Platform
- Windows
Code:
Sub Show_Page()
Dim sh1 As Worksheet, lc As Long
Set sh1 = Worksheets("Sheet1")
lc = sh1.Cells(1, sh1.Columns.Count).End(xlToLeft).Column
sh1.PageSetup.PrintArea = sh1.Range("A1:A" & sh1.Cells(sh1.Rows.Count, 1).End(xlUp).Row).Resize(, lc).Address
With sh1
.PrintOut 2, 2, , -1
End With
End Sub
Above macro will just preview page2 of n pages.
Is it possible to get the address of that page2 range?
I know I can get it with HPageBreaks but that is not what I am after.
On my test workbook, page2 is A48:J94 and this address is what I am after.
If you could just change ".PrintOut 2, 2, , -1" to ".MsgBox 2, 2, , -1 .Address" that would be it!!!!!!