defined names corrupt after saving

jless

New Member
Joined
May 28, 2012
Messages
3
After saving my excel file the names I defined using "Insert>Name>Define..." become corrupted. The name changes from what I entered
=OFFSET(historical!F$9,0,0,COUNT(historical!$F$9:$F$300))


to this =OFFSET(historical!M$9,0,0,COUNT(historical!$F$9:$F$300))

I am using the defined names to make dynamic range charts. Each time after I save excel corrupts the defined names which clears out the data I have on my dynamic ranging charts.

It always changes the part in red to something random like "P" or "XJM" for example. Any help would be greatly appreciated!!

I am using Excel 2010
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Welcome to the forum!

Actually, nothing is corrupted!

An important point to consider when defining names having relative cell reference(s) is to select the cell where the name will be used then define the name.

Why?

Think of it like entering a formula. Considering the example in your post, if the formula is entered in the original location it will have the first form. After that if it has been copied to different column the references will be adjusted as per the new location (the second form). Same happens with names.

To check whether the name is really corrupted or not, select the original cell, where the name was first defined, and check the formula.
 
Upvote 0
I follow what you are saying, but I am not sure it applies directly to dynamic ranging charts.

After playing around with it for a bit I fixed the problem by simply saving the name as =OFFSET($F$9,0,0,COUNT(historical!$F$9:$F$300))

I did this for all the names and it worked. For some reason leaving off the sheet name "historical!" fixed the problem. Maybe it made the name a global variable for the whole workbook. I'm not sure, but it fixed the problem. All the dynamic ranging charts were working properly even after I saved the file.


Thanks anyways for the help!!! :)
 
Upvote 0
Glad to know your problem has been solved. Al-hamdullah.

Maybe it made the name a global variable for the whole workbook.

Excel always adds the sheet reference whether the scope is Workbook or Sheet. I don’t think we can say it becomes a global variable because the sheet reference is added.

Also, you don’t need to sacrifice the relative addressing. Sometimes defined names need adjustment after the have been defined (I don’t know why, but it seems this has happened in your case).

…but I am not sure it applies directly to dynamic ranging charts

Defined names whether static ranges or dynamic ranges can be used in charts or elsewhere. The definition is the same.
 
Upvote 0
How would one create a name so that is is global or consistent throughout all the sheets? I have tried to find information about it and all I could find is ways to do it using VBA code.

Is their a way to create global names without using code? Would it be better to define my names as global so I can use them on a chart on any sheet without having any conflict?
 
Upvote 0
How would one create a name so that is is global or consistent throughout all the sheets? I have tried to find information about it and all I could find is ways to do it using VBA code.

To define names that can be used in all sheets make the Scope Workbook (a popup list found when defining the name after clicking Add). And if you want a name to be specific to a Worksheet then select the sheet name in the Scope popup list.

Is their a way to create global names without using code? Would it be better to define my names as global so I can use them on a chart on any sheet without having any conflict?

I am not clear about what you mean here, but if you define a name and make the scope Workbook, then you can use this name in every sheet, keeping in mind that the names will always refer to the source data (ranges).
 
Upvote 0
Name: OneCell RefersTo: =Sheet1!$A$1
Name: SomeCell RefersTo: =!$A$1

OneCell will always refer to a cell on sheet 1.
SomeCell will always refer to a cell on the sheet where the name is used.

The ! (without a sheet name) acts as a "relative sheet" indicator when used in the definition of a name.
 
Upvote 0
Thank you mikerickson very much for the "relative sheet" information! Never heard about it.
All the best
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,791
Messages
6,174,605
Members
452,574
Latest member
hang_and_bang

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