Renaming Multiple Worksheets

uberathlete

Board Regular
Joined
Jul 11, 2007
Messages
117
Hi everyone. Got a problem and I really need some help. Basically, I have a workbook with plenty of worksheets. I would like to rename the worksheets based on some criteria.

For example, in each worksheet, column A is a column for dates. None of the worksheets have the same dates:

626juw6.jpg


I would like the worksheet to be named: SXFMONTHDAY.YEAR

wherein MONTH is the first 3 letters of the month , DAY is the day , and year is the last 2 digits of the year. So in this case, Sheet1 would be named: SXFJan3.06

Then, Sheet2 will be renamed based on it's date and the worksheet name format just mentioned. The rest of the worksheets are also renamed the same way.

I'm sure some VBA is needed for this but I'm really bad at it. Any suggestions or comments would be greatly appreciated. Thank you!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi everyone. Got a problem and I really need some help. Basically, I have a workbook with plenty of worksheets. I would like to rename the worksheets based on some criteria.

For example, in each worksheet, column A is a column for dates. None of the worksheets have the same dates:

626juw6.jpg


I would like the worksheet to be named: SXFMONTHDAY.YEAR

wherein MONTH is the first 3 letters of the month , DAY is the day , and year is the last 2 digits of the year. So in this case, Sheet1 would be named: SXFJan3.06

Then, Sheet2 will be renamed based on it's date and the worksheet name format just mentioned. The rest of the worksheets are also renamed the same way.

I'm sure some VBA is needed for this but I'm really bad at it. Any suggestions or comments would be greatly appreciated. Thank you!

Press ALT+F11, insert module, paste below code:


Code:
Sub test()

Dim Sht As Worksheet


For Each Sht In Worksheets
    With Sht
    .Name = "SFX" & Format(.Range("a2"), "mmmdd") & "." & Format(.Range("a2"), "yy")
    
    End With

Next Sht

End Sub

Press F5 to run the codes.
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

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
Back
Top