Excel Macro: use of 'if' command

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

Have a macro which users will access based upon varying
reports (returned on a monthly basis - each time
the 'sheet tab' will have a different name.

Need macro to include statement to say : if spreadsheet
has a tab including the works 'works summary' rename
to "WOS".

As each report will have different numbers at the end of
works summary name.
 
Hi Greg
This code finds a sheet whose name includes "works summary", an
renames that sheet "WOS"


Sub rename_sheets()
For Each ss In ActiveWorkbook.Sheets
On Error Resume Next
ff = Application.WorksheetFunction.Find("works summary", ss.Name)
If ff <> "" Then ss.Name = "WOS"
Next
End Su
 
Back
Top