Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 83
Default Naming a worksheet tab from a reference cell

Hi All,

Using Excel 2007

Can I name a worksheet tab from a cell contained within the worksheet. I
want to name a worksheet from the date contained in say A1 =
30/06/2009(dd/mm/yyyy)
so the tab would be called 'June' from the moonth number in A1.

If so could someone give me either the function or the code to do this. If
it is code could also detail how to apply it,as I am not that familiar with
code.

Many thanks for taking the time out to respond.

FinanceGuru


--
Wales - the land of fire breathing dragons and rugby playing wizards.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Naming a worksheet tab from a reference cell

You will need to get a formula to extract the month from your date. Sheet
names can not be blank or contain certain symbols: / \ [ ] * ?. So, in A2,
place this formula:
=TEXT(A1,"mmmm")

You'll then need to use code. This will set your sheet name to the value of
A1 when sheet is activated. Right click on the sheet tab, view code, paste
this in:

Private Sub Worksheet_Activate()
Activesheet.Name = Range("A2").Value
End Sub

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Finance Guru" wrote:

Hi All,

Using Excel 2007

Can I name a worksheet tab from a cell contained within the worksheet. I
want to name a worksheet from the date contained in say A1 =
30/06/2009(dd/mm/yyyy)
so the tab would be called 'June' from the moonth number in A1.

If so could someone give me either the function or the code to do this. If
it is code could also detail how to apply it,as I am not that familiar with
code.

Many thanks for taking the time out to respond.

FinanceGuru


--
Wales - the land of fire breathing dragons and rugby playing wizards.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Naming a worksheet tab from a reference cell

Improved code:
Rather than use a formula in worksheet, can do it directly via code with this:

Private Sub Worksheet_Activate()
ActiveSheet.Name = WorksheetFunction.Text(Range("A1").Value, "mmmm")
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Finance Guru" wrote:

Hi All,

Using Excel 2007

Can I name a worksheet tab from a cell contained within the worksheet. I
want to name a worksheet from the date contained in say A1 =
30/06/2009(dd/mm/yyyy)
so the tab would be called 'June' from the moonth number in A1.

If so could someone give me either the function or the code to do this. If
it is code could also detail how to apply it,as I am not that familiar with
code.

Many thanks for taking the time out to respond.

FinanceGuru


--
Wales - the land of fire breathing dragons and rugby playing wizards.

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
Naming worksheets tabs from another cell reference Finance Guru Excel Worksheet Functions 2 July 1st 09 07:00 PM
reference cell from previous worksheet without "naming" worksheet Kristin Excel Worksheet Functions 3 August 20th 07 08:30 PM
Worksheet naming with cell info HFM - LEE Excel Worksheet Functions 3 August 9th 07 09:30 PM
Naming Cell in diffetn worksheet Yan Excel Worksheet Functions 10 September 26th 06 07:36 PM
Naming Cell on differnt worksheet Yan Excel Worksheet Functions 0 September 25th 06 05:52 PM


All times are GMT +1. The time now is 05:13 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"