Name worksheets (tabs) according to value present in cell

gameover

Active Member
Joined
Jan 12, 2009
Messages
292
Hi All,

I have a workbook (2003) which is having 70-80 tabs. I want to name all those tabs according to value present in cell C3 of every tab. eg. If in my sheet 1 value present in C3 is DC-00012 then sheet 1 should be named as DC-00012 and so on.

I hope I have cleared myself. Please revert in case of any questions.

Thanks a lot in advance!!!!!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
As a minimal attemp the below will work - consider adding error trapping for illegal names etc...

Code:
Private Sub CommandButton1_Click()
Dim oWks As Worksheet

For Each oWks In ActiveWorkbook.Worksheets

    oWks.Name = oWks.Range("C3")

Next oWks


End Sub
 
Upvote 0
Hi Ben and Will,

Thanks a lot for your code. Both your code worked fine. But Ben's code suited my question.

Thanks a lot again for all your help!!!!!:)
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,268
Members
448,558
Latest member
aivin

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