linked cells - source sheetname changes

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
1,871
Office Version
  1. 365
Platform
  1. Windows
I need to make changes to 140 odd sheet names in my master file. each of these sheets is linked to a range of cells in a WIP report. How can I make my name changes and not lose the links to the other workbook? can you create a link to a sheets index rather than name??
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

dafan

Well-known Member
Joined
May 6, 2008
Messages
692
If you change your sheet name in your master file any references in any subfile will change too.

For example
Code:
'[Filename]Sheet1'!A1
will change to
Code:
'[Filename]Sheet1-1'!A1
if you change Sheet1 to Sheet1-1 in Filename.
 
Last edited:

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
1,871
Office Version
  1. 365
Platform
  1. Windows
thanks dafan. perhaps you can help further. I have a list of the existing sheet names next to the new sheet names. i need to loop through each sheet, find the existing sheet name in my list, and then change it to the new name. any ideas?
 

dafan

Well-known Member
Joined
May 6, 2008
Messages
692
This code is not complete as I'm not sure how to refer to sheetnames dynamically:
Not tested.


Say A1 houses your current sheetname, B1 is new sheetname. You have 4 sheets
Code:
For i = 1 to 4

 Cursheet = Range("A" & 1).Text
 Newsheet = Range("B" & 1).Text
 Sheets(Cursheet).Name = Newsheet
Next i

Good luck. HTH.
 
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,164,506
Messages
5,837,745
Members
430,515
Latest member
K_Lynch

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