Forum Discussion
ajl_ahmed
Jul 09, 2022Iron Contributor
creating three buttons to display page 1, page 2 and all pages of sheet 1 (excel file)
 I have a worksheet in an excel file (Office 365) consisting of two pages in (sheet 1). I want to create three buttons as described below:  button 1: to display page 1 of sheet 1 only.  button 2: to d...
NikolinoDE
Jul 10, 2022Platinum Contributor
So you could generate page previews for each individual sheet...insert code in a VBA button.
Option Explicit
Sub Print_Preview()
With ActiveSheet.PageSetup
ActiveWindow.SelectedSheets.PrintPreview
'ActiveSheet.PageSetup.PrintArea = "A1:AH60" 'only if you like to see only specific area
End With
End Sub