Hi everyone:
I'm trying to apply print settings and a few other format settings (row height, hide columns, etc) to only certain sheets in my workbook. However, when I run the code, it stays on the first tab (Summary tab) and applies the code but this is a sheet that I don't want to apply my settings to.
Sub FormatSheets()
Dim ws As Worksheet
ws.Activate
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "Summary", "ARO"
Case Else
With ws.PageSetup
.PrintTitleRows = "$1:$1"
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
End With
ws.Cells.Select
Selection.WrapText = True
Selection.ColumnWidth = 10
Selection.EntireRow.AutoFit
Range("A:A,U:U,W:W,Y:Y,Z:Z,AE:AE,AG:AG,AI:AI,AJ:AJ,AP:AP").EntireColumn.Hidden = True
End Select
Next ws
End Sub
Any help will be appreciated!
Bookmarks