Use this:
Option Explicit
Sub Format_Specific_Sheets()
On Error GoTo ErrHandler:
Dim Sheetlist As Variant
Dim i As Integer
Sheetlist = Array("Hoja1", "Sheet1", "Sheet3", "Sheet4", "Sheet5") 'Define sheet names, to format
For i = LBound(Sheetlist) To UBound(Sheetlist)
' Your Code Goes Here
Worksheets(Sheetlist(i)).Range("F4:I8").Font.Bold = True
Next
Exit Sub
ErrHandler:
If Err.Number = 9 Then 'Sheet does not exist
MsgBox "No more sheets fullfill the criteria. All operations completed succesfully", vbInformation, "Done"
Else
MsgBox "Error " & Err.Number & " (" & Err.Description & ")", vbInformation, "Humm..."
Exit Sub
End If
End Sub
Bookmarks