dunamic tab name

Scholar

New Member
Joined
Jul 30, 2009
Messages
44
Hello People,

I find it frustrating to keep updating the tab name every month for a report I produce. Especially, since the month is made referrence to in a cell within the worksheet. Is there a way to maybe concatenate or create a formula to keep this current automatically?

Thanks for all your help...past and future!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
You can do this with a macro like this

Code:
Sub Namesheet()
ActiveSheet.Name = Format(Range("A1").Value, "dd-mm-yyyy")
End Sub

change A1 to suit.
 
Upvote 0

p45cal

Well-known Member
Joined
Nov 10, 2009
Messages
4,763
or if your date is in say M4, then in an event (paste this into the sheet concerned's code module):
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Parent.Name = Format(Range("M4").Value, "MMM yy")
End Sub
 
Upvote 0

Scholar

New Member
Joined
Jul 30, 2009
Messages
44
thanks you VoG. Can I apply my own format/wording in a cell that becomes the tab name like say, "Month of Mach 2010", rather then dd-mm-yyyy?
 
Upvote 0

Scholar

New Member
Joined
Jul 30, 2009
Messages
44
ADVERTISEMENT
thank you p45cal. Now i am getting ahead of myself, as im a VBA newbie. What if i wanted to add a button to activate this macro?
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

Code:
Sub Namesheet()
ActiveSheet.Name = "Month of " & Format(Range("A1").Value, "mmmm yyyy")
End Sub

You can assign this to a button from the Forms toolbar.
 
Upvote 0

Forum statistics

Threads
1,196,027
Messages
6,012,950
Members
441,740
Latest member
abaz21

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top