Rename Tabs Based on a Contents Page

G16LYB

New Member
Joined
Nov 23, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi

Apologies I know this has been asked before but I cant find anything that seems to cover this specifically.

I have a workbook that I want to have a contents page with a reference number, I've then linked this reference to another sheet in cell A1. I've found some basic code that renames the tab, but if the reference changes in the contents it doesn't update the sheet unless you go into it and click into a cell.

I'll need a lot of tabs in the workbook, possibly 200 with the ability to add more if required.

I'm pretty proficient with excel, but I've zero experience with VBA so detailed instructions would be really helpful.

Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
18,233
Office Version
  1. 2013
Platform
  1. Windows
Not sure what this means:
You said:
page with a reference number

Are you wanting a Hyperlink in your Contents sheet that you can click on to goto a sheet name you have in column 1 of Contents Page?
 

G16LYB

New Member
Joined
Nov 23, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Maybe I should say Contents Sheet, I want the tabs to rename based on a value on this sheet. So say the contents tab cell A1 has a reference "1008" I want sheet 1 to rename as "1008".

I've linked this directly into a tab. So say Contents A1 links to Sheet1 cell A1, then Contents B1 links to Sheet2 cell A1. What I want to happen is if the data in Contents A1 changes it should rename the tab Sheet1 to the value. Does that make sense?
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
18,233
Office Version
  1. 2013
Platform
  1. Windows
When you say Linked. Do you mean a Hyperlink?

And you said:
say Contents A1 links to Sheet1 cell A1, then Contents B1

So you have all your sheet names in column A or Row(1)
A1 Means column A B1 means Column B
 

G16LYB

New Member
Joined
Nov 23, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

No I dont want a hyperlink

Sorry I meant column A. In the contents tab I have all the sheet names in column A. In each sheet its linked to this contents tab, so thats sorted. What I want to happen is the tab name automatically change to the value in A1 of that sheet.

I've got a simple VBA for it, but it doesnt update. I want it to update based on a change on the Contents tab, which in turn changes cell A1 in the sheet.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
18,233
Office Version
  1. 2013
Platform
  1. Windows
You said:
In each sheet its linked to this contents tab,

What does linked mean?
How is it linked?
And you said:
I've got a simple VBA for it, but it doesnt update.
Show me your Vba Code?
 

G16LYB

New Member
Joined
Nov 23, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Its linked directly, no formula, just a straight = then the cell reference on the other tab. Thats kind of irrelevant, its the tab renaming I want.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
ActiveSheet.Name = ActiveSheet.Range("A1")
End If
End Sub
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
67,938
Office Version
  1. 365
Platform
  1. Windows
Its linked directly, no formula, just a straight =
That means it is a formula. Anything that starts = is a formula & change events do not get triggered via formulae.
Do you want to rename any sheet based on the value in A1 of that sheet?
 

G16LYB

New Member
Joined
Nov 23, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Lets draw a line under the formula!

Yes I do, but I want it to update if there is a change made. My point being that the change isnt going to happen directly in the sheet, its going to happen in another, and that process doesnt update the tab name unless you go back to the tab and force it by selecting a cell
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
67,938
Office Version
  1. 365
Platform
  1. Windows
Does your contents page have a formula linking to another sheet, or are you changing the contents page manually?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,772
Messages
5,766,387
Members
425,350
Latest member
procha

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
Top