Hi there, I have written a macro for a specific workbook to apply to multiple worksheets, I have about 30 other workbooks to apply this to and the sheet numbers will be different in each work book. All sheets that need to be formatted contain the word "plot" in the name. How do I set a variable to activate any worksheets with "plot" in their name? here is the macro I would like to modify: Sub MacroThroughsheets()
Dim i As Integer
For i = 56 To 70
Sheets(i).Activate
ActiveSheet.Columns("A:A").ColumnWidth = 2
ActiveSheet.Columns("B:B").ColumnWidth = 7
ActiveSheet.Columns("C:C").ColumnWidth = 4
ActiveSheet.Columns("D:D").ColumnWidth = 7
ActiveSheet.Columns("E:E").ColumnWidth = 10
ActiveSheet.Columns("F:F").ColumnWidth = 9
ActiveSheet.Columns("G:G").ColumnWidth = 4
ActiveSheet.Columns("H:T").ColumnWidth = 8.14
ActiveSheet.Columns("U:U").ColumnWidth = 2
Rows("1:51").Select
Selection.RowHeight = 15
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$51"
Next i
End Sub
Thank you!
Dim i As Integer
For i = 56 To 70
Sheets(i).Activate
ActiveSheet.Columns("A:A").ColumnWidth = 2
ActiveSheet.Columns("B:B").ColumnWidth = 7
ActiveSheet.Columns("C:C").ColumnWidth = 4
ActiveSheet.Columns("D:D").ColumnWidth = 7
ActiveSheet.Columns("E:E").ColumnWidth = 10
ActiveSheet.Columns("F:F").ColumnWidth = 9
ActiveSheet.Columns("G:G").ColumnWidth = 4
ActiveSheet.Columns("H:T").ColumnWidth = 8.14
ActiveSheet.Columns("U:U").ColumnWidth = 2
Rows("1:51").Select
Selection.RowHeight = 15
ActiveSheet.PageSetup.PrintArea = "$A$1:$U$51"
Next i
End Sub
Thank you!