linked cells - source sheetname changes

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,005
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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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:
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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