I have code below to see the print Preview. I need the code amended so as to display only the range of the unhidden columns i.e visible data
When running the macro, the preview shows the hidden columns , which I do not want to see
for eg if Unhidden Range is A:B and I:J, then I only want to print A2 to last row in Col B and I2 to last row in Col J
It would be appreciated if someone could kindly amend my code
When running the macro, the preview shows the hidden columns , which I do not want to see
for eg if Unhidden Range is A:B and I:J, then I only want to print A2 to last row in Col B and I2 to last row in Col J
It would be appreciated if someone could kindly amend my code
Code:
Sub Print_Preview()
Sheets("Summary").Select
Range("A1").Select
LR = Sheets("Summary").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("Summary").Select
With ActiveSheet.PageSetup
.PrintGridlines = True
.PrintArea = "A2:AC" & LR + 5
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = ""
.LeftHeader = "&D&T"
.CenterHeader = "SVC and Parts Turnover"
.Orientation = xlLandscape
.FitToPagesWide = 1
End With
Sheets("Summary").Select
ActiveWindow.View = xlPageBreakPreview
ActiveSheet.UsedRange.EntireColumn.AutoFit
Range("A1").Select
End Sub