I want to execute the following VBA code for each worksheet at once in an Excel file:
Sub sample_code()
Columns("B:B").Select
Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A:A,D:J").Select
Range("D1").Activate
Selection.Delete Shift:=xlToLeft
Columns("F:P").Select
Selection.Delete Shift:=xlToLeft
Columns("A:E").EntireColumn.AutoFit
Columns("B:B").ColumnWidth = 30.86
Range("A1:E1").Select
Selection.Font.Bold = True
End Sub
How can I do that?
Like this: