Auto Name Tab based on cell

ryan_law2000

Well-known Member
Joined
Oct 2, 2007
Messages
738
Hey Everyone

I would like the tab at the bottom of the sheet to Automactially name = to cell C5
So if Cell C5 = "Ryan"
The tab at the bottom of the sheet will be named "Ryan"

Any ideas???
 
Hello I hope this thread isn't too old. I am attempting to auto name my tabs based on a cell in the worksheet.
I tried the first example given to "Ryan" but it isn't working. The cell I want to name the tab after is L1 and is a number. Can anyone help? Thanks in advance.
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Re: what about dates?

Hi,

I used this code and worked fine. But, I would have to name the sheet based on values on 2 cells (B4=Low and D8=Trip), something like if B4-D8 ie, sheet name should be Low-Trip.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "B4" Then Me.Name = Target.Value
End Sub
 
Last edited:
Upvote 0
Re: what about dates?

Hi,

I used this code and worked fine. But, I would have to name the sheet based on values on 2 cells (B4=Low and D8=Trip), something like if B4-D8 ie, sheet name should be Low-Trip.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "C5" Then Me.Name = Target.Value
End Sub
 
Upvote 0
Hi,

how are u?

I need to have XYZ followed by 123 ant the tab changes to:-
Example

hello - 123

or

goodbye - 123.



is this what you want?
 
Upvote 0
If you are changing C5 manually try this. Right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "C5" Then Me.Name = Target.Value
End Sub

then press ALT + Q to return to your sheet.

Here’s the issue I am running into, I created a Lead Sheetwith a
First Name: Jon
Last Name: Smith
Full Name: Jon Smith (this is a formula using & sign)
Next tab that I have is an invoice and it picks up the datafrom cell C5 and that cell C5 takes data from the Lead Sheet. So C5 displaysJon Smith.
Once I have a new set of data and Jon Smith becomes MikeJohnson C5 updates but the tab name doesn’t. I noticed if I go to C5, click onthe address bar and hit Enter the name updates. But not automatically.
Any suggestions to fix this, preferably the easiest waypossible as I am not an Excel wizard and pretty much just a regular shmuck.

Thank You.
 
Upvote 0
I actually have the same question as Ryan in the beginning of this thread but I need a formula that works for the entire workbook including when I open a new tab. Please help
 
Upvote 0
hi,

I use :-

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Set Target = Range("d8")
    If Target = "" Then Exit Sub
    On Error GoTo Badname
    
ActiveSheet.Name = "[COLOR=rgb(226, 80, 65)][B]TimeSheetWE[/B][/COLOR]" & Format(Range("d8").Value, "dd-mm-yyyy")
    
    Exit Sub
Badname:
    MsgBox "Please revise the entry in d8." & Chr(13) _
    & "It appears to contain one or more " & Chr(13) _
    & "illegal characters." & Chr(13)
    Range("d8").Activate
    ActiveWorkbook.SaveAs Filename:="[COLOR=rgb(226, 80, 65)][B]C:\TimeSheets[/B][/COLOR]" & Application.PathSeparator & ActiveWorkbook.Sheets(1).Name
End Sub

[CODE=vba]

Works for me. You will have to alter ' [COLOR=rgb(226, 80, 65)][B]red [/B][/COLOR][COLOR=rgb(0, 0, 0)][B]Bold [/B][/COLOR][COLOR=rgb(226, 80, 65)][B]text[/B][/COLOR]' to your personal choice.

good luck
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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