Macro to Rename Multiple Sheets

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

Is there a way to create a macro that will rename one
sheet in a workbook, go to the next sheet, rename that
sheet and continue to the last sheet in the workbook? I
want the sheet name to match the formated date output of a
cell on each respective sheet. I want to copy the
formated date displayed in cell G3, paste it as the sheet
name and then have the macro move to the next sheet and do
the same thing using cell G3 on that sheet. I have done
this manually with the date format being 01-Jan-04 which
is fine. I have 52 sheets, one for each week of the year
and doing this manually is time consuming.
 
Alan,

Here's some code

For i = 1 To Worksheets.Count
Worksheets(i).Name = Format(Worksheets(i).Range("G3").Value,
"dd-mmm-yy")
Next i

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top