#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Worksheet name

Is there a method of using a formula/macro to name a worksheet and have that
worksheet name change according to the month?

i have a workbook with 24 worksheets that are named as Nov 2007 and so on.

Using the computers time and date settings to change a worksheet name once
that month has expired ie on Dec 1 2007, change the worksheet Nov 2007 would
change to Dec 2009, therby keeping 24 worksheets with the next 24 months as
sheetnames.

thanks


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Worksheet name

Thankks Don

Could you explain a little on how it works. I pasted your code into vba but
nothing happens. Do i need to put sheet names into the code?

thanks

"Don Guillett" wrote:

try this
Sub namesheets()
For i = Sheets.Count To 1 Step -1 'or 24 to 1 step -1
Sheets(i).Name = Format(DateSerial(Year(Date), i, 1), "mmm yy")
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"curiosity_killed_the_cat"
m wrote in message
...
Is there a method of using a formula/macro to name a worksheet and have
that
worksheet name change according to the month?

i have a workbook with 24 worksheets that are named as Nov 2007 and so on.

Using the computers time and date settings to change a worksheet name once
that month has expired ie on Dec 1 2007, change the worksheet Nov 2007
would
change to Dec 2009, therby keeping 24 worksheets with the next 24 months
as
sheetnames.

thanks




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Worksheet name

Thanks for your effort Don.

I got it working a treat, as it turned out I wasn't describing what I wanted
too good.

Thanks

"Don Guillett" wrote:

I just re-tested successfully in xl2003.
Did you have any word wrap? The sheets line is one line
1 line for
1 line sheets
1 line next

How did you fire the macro? One way is while cursor in the macrotouch f5
key.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"curiosity_killed_the_cat"
wrote in message ...
Thankks Don

Could you explain a little on how it works. I pasted your code into vba
but
nothing happens. Do i need to put sheet names into the code?

thanks

"Don Guillett" wrote:

try this
Sub namesheets()
For i = Sheets.Count To 1 Step -1 'or 24 to 1 step -1
Sheets(i).Name = Format(DateSerial(Year(Date), i, 1), "mmm yy")
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"curiosity_killed_the_cat"
m wrote in message
...
Is there a method of using a formula/macro to name a worksheet and have
that
worksheet name change according to the month?

i have a workbook with 24 worksheets that are named as Nov 2007 and so
on.

Using the computers time and date settings to change a worksheet name
once
that month has expired ie on Dec 1 2007, change the worksheet Nov 2007
would
change to Dec 2009, therby keeping 24 worksheets with the next 24
months
as
sheetnames.

thanks








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Worksheet name

What did you want and what did you use?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"curiosity_killed_the_cat"
wrote in message ...
Thanks for your effort Don.

I got it working a treat, as it turned out I wasn't describing what I
wanted
too good.

Thanks

"Don Guillett" wrote:

I just re-tested successfully in xl2003.
Did you have any word wrap? The sheets line is one line
1 line for
1 line sheets
1 line next

How did you fire the macro? One way is while cursor in the macrotouch f5
key.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"curiosity_killed_the_cat"

wrote in message
...
Thankks Don

Could you explain a little on how it works. I pasted your code into vba
but
nothing happens. Do i need to put sheet names into the code?

thanks

"Don Guillett" wrote:

try this
Sub namesheets()
For i = Sheets.Count To 1 Step -1 'or 24 to 1 step -1
Sheets(i).Name = Format(DateSerial(Year(Date), i, 1), "mmm yy")
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"curiosity_killed_the_cat"
m wrote in message
...
Is there a method of using a formula/macro to name a worksheet and
have
that
worksheet name change according to the month?

i have a workbook with 24 worksheets that are named as Nov 2007 and
so
on.

Using the computers time and date settings to change a worksheet
name
once
that month has expired ie on Dec 1 2007, change the worksheet Nov
2007
would
change to Dec 2009, therby keeping 24 worksheets with the next 24
months
as
sheetnames.

thanks







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
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Excel Worksheet Functions 2 September 7th 06 05:05 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Discussion (Misc queries) 2 August 24th 06 05:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Worksheet Functions 2 August 24th 06 05:26 PM
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet Aster Excel Worksheet Functions 3 March 12th 06 09:58 AM
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. [email protected] Excel Discussion (Misc queries) 0 September 22nd 05 04:39 PM


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