I have below codes to format multiple sheets at once, but it doesn't work. Anyone knows why? Thank you so much!
Sub Format_All()
Dim ws As Worksheet
For Each ws In Sheets(Array("1400", "1401", "1402", "1403", "1404", "1406", "1407", "1408", "1409", "1410", _
"1411", "1413", "1414", "1415", "1416", "1417", "1418", "1419", "1421", "1424", "1425"))
Sheets("1400").Activate
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("E:E").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Columns("E:E").Select
Selection.Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Columns("C:G").Select
Selection.EntireColumn.Hidden = True
Columns("K:M").Select
Selection.EntireColumn.Hidden = True
Columns("Q:Q").Select
Selection.EntireColumn.Hidden = True
Columns("S:S").Select
Selection.EntireColumn.Hidden = True
Columns("U:W").Select
Selection.EntireColumn.Hidden = True
Columns("X:X").Select
Selection.Delete Shift:=xlToLeft
Columns("Y:Y").Select
Selection.Replace What:="1", Replacement:="Yes", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="0", Replacement:="No", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Rows("1:1").RowHeight = 26.25
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("B:B").ColumnWidth = 7.86
Columns("H:H").ColumnWidth = 7.71
Columns("I:I").ColumnWidth = 9.29
Columns("J:J").ColumnWidth = 29
Columns("N:N").ColumnWidth = 20.57
Columns("O:O").ColumnWidth = 9.57
Columns("R:R").ColumnWidth = 10.14
Columns("T:T").ColumnWidth = 30.57
Columns("X:X").ColumnWidth = 6.57
Columns("Y:Y").ColumnWidth = 9.43
Next ws
Set ws = Nothing
Sheets("Worksheet").Select
End Sub
Sub Format_All()
Dim ws As Worksheet
For Each ws In Sheets(Array("1400", "1401", "1402", "1403", "1404", "1406", "1407", "1408", "1409", "1410", _
"1411", "1413", "1414", "1415", "1416", "1417", "1418", "1419", "1421", "1424", "1425"))
Sheets("1400").Activate
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("E:E").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Columns("E:E").Select
Selection.Cut
Columns("B:B").Select
Selection.Insert Shift:=xlToRight
Columns("C:G").Select
Selection.EntireColumn.Hidden = True
Columns("K:M").Select
Selection.EntireColumn.Hidden = True
Columns("Q:Q").Select
Selection.EntireColumn.Hidden = True
Columns("S:S").Select
Selection.EntireColumn.Hidden = True
Columns("U:W").Select
Selection.EntireColumn.Hidden = True
Columns("X:X").Select
Selection.Delete Shift:=xlToLeft
Columns("Y:Y").Select
Selection.Replace What:="1", Replacement:="Yes", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="0", Replacement:="No", LookAt:=xlPart, _
SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Rows("1:1").RowHeight = 26.25
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Columns("B:B").ColumnWidth = 7.86
Columns("H:H").ColumnWidth = 7.71
Columns("I:I").ColumnWidth = 9.29
Columns("J:J").ColumnWidth = 29
Columns("N:N").ColumnWidth = 20.57
Columns("O:O").ColumnWidth = 9.57
Columns("R:R").ColumnWidth = 10.14
Columns("T:T").ColumnWidth = 30.57
Columns("X:X").ColumnWidth = 6.57
Columns("Y:Y").ColumnWidth = 9.43
Next ws
Set ws = Nothing
Sheets("Worksheet").Select
End Sub