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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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?
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0
Does your contents page have a formula linking to another sheet, or are you changing the contents page manually?
 
Upvote 0

Forum statistics

Threads
1,212,933
Messages
6,110,752
Members
448,295
Latest member
Uzair Tahir Khan

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