Hi guys,
I recorded a macro that'll reformat 1 sheet on the WB i'm working on. Is it possible to apply this format on all WS' on my workbook by using only 1 macro?
I've pasted the recorded macro below. Any help will be much appreciated.
Application.ScreenUpdating = False
'Sheets("1").Select
'Clear print area
ActiveSheet.PageSetup.PrintArea = ""
Range("A2:U2").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
.PatternTintAndShade = 0
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Font.Bold = True
Sheets("master").Select
Range("A2:T2").Select
Selection.Copy
Sheets("1")).Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("S:S").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("S2").Select
ActiveCell.FormulaR1C1 = "Comments"
Range("A2:U2").Select
Range("U2").Activate
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
End With
Selection.Font.Bold = True
With Selection.Font
.ColorIndex = xlAutomatic
End With
Range("A3:U600").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Rows("1:1").RowHeight = 43.5
Rows("2:2").RowHeight = 43.5
Rows("3:500").Select
Selection.RowHeight = 30
Range("A2:U2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Range("A2:U2").Select
With Selection.Font
.Name = "Arial"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
'Make column B3 and down, font 10 pt
Range("B3").Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Font
.Name = "Arial"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
'Center whole sheet
Cells.Select
With Selection
.HorizontalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
'Autofit all columns except for S and T
' Columns("A:A").ColumnWidth = 12.25
Columns("A:A").Select
Selection.NumberFormat = "000-00"
Columns("A:A").ColumnWidth = 12.25
Columns("B:B").ColumnWidth = 41.86
Columns("C:C").ColumnWidth = 3.25
Columns("D:D").Select
Selection.NumberFormat = "General"
Columns("D:D").ColumnWidth = 4
Columns("E:E").ColumnWidth = 11
Columns("F:F").Select
Selection.NumberFormat = "000000"
Columns("F:F").EntireColumn.AutoFit
Columns("G:G").Select
Selection.NumberFormat = "000000"
Columns("G:G").EntireColumn.AutoFit
Columns("H:H").Select
Selection.NumberFormat = "General"
Columns("H:H").ColumnWidth = 7.13
Columns("I:I").ColumnWidth = 7.38
Columns("J:J").EntireColumn.AutoFit
Columns("K:K").ColumnWidth = 10
Columns("L:L").EntireColumn.AutoFit
Columns("M:M").EntireColumn.AutoFit
Columns("N:N").ColumnWidth = 7.88
Columns("O:O").EntireColumn.AutoFit
Columns("P:P").EntireColumn.AutoFit
Columns("Q:Q").ColumnWidth = 3.63
Columns("R:R").ColumnWidth = 12.25
Columns("S:S").ColumnWidth = 21.38
Columns("T:T").EntireColumn.AutoFit
Columns("U:U").EntireColumn.AutoFit
Columns("V:Z").Select
Selection.Delete Shift:=xlToLeft
Range("A3:U3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=MOD(ROW(),2)=1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.799981688894314
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("C1").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Selection.NumberFormat = "h AM/PM"
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Range("F1:L1").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("F1:L1").Select
Selection.NumberFormat = "mmmm-dd-yyyy"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
With Selection.Font
.Name = "Verdana"
.Size = 22
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Selection.Font.Bold = True
Range("A2:U2").Select
Selection.AutoFilter
Thanks.
Bookmarks