Rename worksheet tabs

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

I have a 12 worksheets labeled Jan, Fed, Mar ect.. What I need is something
which will rename the tabs to include the correct year and that value will
be found in cell W1 of each sheet.
 
Yes each tab would have the same year. I am setting this up as a template
document that will be started fresh each year.
 
Select the 12 worksheets first.

Option Explicit
Sub testme()
dim wks as worksheet
for each wks in activewindow.selectedsheets
wks.name = wks.name & " " & wks.range("W1").value
next wks
end sub

The new names will be like:
Jan 2008
(old name, space character, value in W1 of that sheet).

Remember to ungroup the sheets when you're done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top