EXCE Named Range Corruption

Martel

New Member
Joined
Jun 19, 2019
Messages
14
Named Ranges become corrupted readily. I am writing a fairly large application using VBA and named ranges extensively. I have a major problem - it appears that in the event of any error in coding, wherever and not related to anything in particular, the defined named ranges are the first thing to go. Using Offset in name definition. Error is that range locations are replaced with #REF error. This is happening regularly. I have repeatedly gone through name manager, corrected errors and resaved, only to find this error comes back, often without me changing anything.

I am baffled by this problem and would appreciate any suggestion on how this can be overcome Really holding me up. Thanks
 

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,201
Consider having VBA create/update the named ranges, as required. Then they can be simply defined (as hard ranges) without using OFFSET, MATCH, INDEX, COUNTA, etc, etc
 

Martel

New Member
Joined
Jun 19, 2019
Messages
14
Many thanks Fazza for your reponse. This is my fault but I omitted to mention that I using Dynamic Named Ranges, it is these that are causing all the ptoblems. I do not kow how I could use VBA to create "hard ranges" which at the same time would be dynamic.I suspect this is yet another of the vagaries of Excel which we are expected to put up with. But, if you or anyone else has other ideas I would be pleased to know. Thanks again. Martel
 

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,201
I understood you have dynamic named ranges, Martel. The way to use VBA to create the ranges is to use a programmatic approach instead of the current formulas. Whatever the dynamic formula is doing, having that process done via code.
 

Forum statistics

Threads
1,085,505
Messages
5,384,073
Members
401,881
Latest member
Dato

Some videos you may like

This Week's Hot Topics

Top