Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default rename worksheet based on contents of a cell in different workshee

I have three worksheets within a workbook. The three worksheets are named

"Account Info"
"sep 27,2006"
"lists"

I would like to automatically rename the second worksheet "sep 27, 2006"
based on the contents of cell B6 in the "Account Info" worksheet. The
contents of B6 will be a date in the above format.

The workbook is a template.

How do I do that? I figure I need to right-click the worksheet tab and
enter vba code into the Visual Basic Editor but what is the code?

Can I copy and paste the code or is that not possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default rename worksheet based on contents of a cell in different workshee

try this
Sub RenameSheet()
Worksheets(2).Name = _
Format(Worksheets("Account Info").Range("B6"), _
"[$-409]mmm dd,yyyy;@")
End Sub

"OfficeNDN" wrote:

I have three worksheets within a workbook. The three worksheets are named

"Account Info"
"sep 27,2006"
"lists"

I would like to automatically rename the second worksheet "sep 27, 2006"
based on the contents of cell B6 in the "Account Info" worksheet. The
contents of B6 will be a date in the above format.

The workbook is a template.

How do I do that? I figure I need to right-click the worksheet tab and
enter vba code into the Visual Basic Editor but what is the code?

Can I copy and paste the code or is that not possible?

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
*How can you rename a tab based on a cell value Bob Phillips Excel Discussion (Misc queries) 18 January 2nd 08 08:31 PM
Rename Multiple Excel Workbooks based on cell contents Scott Campbell[_2_] Excel Discussion (Misc queries) 4 April 24th 07 10:00 PM
total two cells from one worksheet to one cell in another workshee SillyLama Excel Discussion (Misc queries) 1 October 17th 06 02:40 AM
new worksheet and rename from cell contents macro Henry Excel Worksheet Functions 1 September 12th 06 10:35 AM
How do I automatically rename a sheet with the contents of a cell. michaelspearin Excel Discussion (Misc queries) 3 December 3rd 04 09:27 PM


All times are GMT +1. The time now is 03:24 AM.

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

About Us

"It's about Microsoft Excel"