Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Macro to Rename Multiple Sheets

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro to Rename Multiple Sheets

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)

"Alan" wrote in message
...
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename of sheets by macro Harshad[_2_] Excel Discussion (Misc queries) 4 October 17th 08 01:09 PM
Macro To Delete/Add & Rename/Arrange Sheets steven.holloway Excel Discussion (Misc queries) 5 June 13th 08 06:40 PM
TO RENAME & COLOR THE SHEETS Ashwini Excel Discussion (Misc queries) 1 September 11th 06 01:20 PM
How do I rename multiple sheets at one time in Excel? Navigator Excel Worksheet Functions 1 July 25th 06 07:51 PM
Add Sheets and rename GregR Excel Discussion (Misc queries) 13 February 13th 05 10:56 PM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"