Cell Value to Equal Worksheet Name

hshure

New Member
Joined
Jan 30, 2007
Messages
19
I have a file where we track all of the recruiters commissions. Each worksheet is given the name of the recruiter it tracks. I would like to have the recruiter name field in the sheet read the worksheet name so that it automatically populates. Can this be done easily?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Thank you so much. That is exactly what I needed. Just out of curiosity, is there a way to do the reverse where the tab name would read a cell value?
 
Upvote 0
Something like this:

Sub RenameWS()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
ws.Name = Range("B2").Value
Next
End Sub

Where "B2" is the cell on each sheet you want to grab the tab name from.
 
Upvote 0
Yes, but it requires VBA.

Something like:

Activesheet.name = Range("A10")
 
Upvote 0
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("D10").Value
End Sub


Michael
 
Upvote 0
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("D10").Value
End Sub


Michael

So would I just paste the code above into a module? I am not very good with VBA. I know Alt+F11 to get to the VB area and then insert module.
 
Upvote 0
Right click on the tab. Select View Code.
In the little pull down you see (general) change it to worksheet. The other pull down choose Change.

Enter the code in the middle!!!

That should do it

Michael
 
Upvote 0
I have 15 Sheets and one Data Entry Sheet. Is there a formula I can put into the Data Entry sheet in different cells that would give me each sheet name ? (Example: Data Entry A1 have sheet 1 name A5 have sheet 2 name etc....
Thanks as always
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

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