ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro eliminating named ranges (https://www.excelbanter.com/excel-programming/321001-macro-eliminating-named-ranges.html)

JonR

Macro eliminating named ranges
 
HI
I have a macro that runs whenever I refresh my worksheet. I also have
dynamic named ranges in the worksheet that I use for charts. Problem is that
whenever I run the macros to refresh the worksheet, two ofhte namved ranges
are erased. I've tried moving them to different parts of the workbook, or
redefining the names, and any of a number of things. They still get erased
every time I refresh the workbook. The really frustrating part is that it
only happens for these two named ranges, which only affect one chart.
Everything else runs perfectly.

Any idea what is going on here? I don't have much hair left to rip out..
TIA

Dave Peterson[_5_]

Macro eliminating named ranges
 
Just guessing--when you refresh your workbook, you delete the range that is
named.

If that's the case, just have your macro that refreshes the workbook create the
name (again).

Just record it when you add it manually and incorporate that into your code.



JonR wrote:

HI
I have a macro that runs whenever I refresh my worksheet. I also have
dynamic named ranges in the worksheet that I use for charts. Problem is that
whenever I run the macros to refresh the worksheet, two ofhte namved ranges
are erased. I've tried moving them to different parts of the workbook, or
redefining the names, and any of a number of things. They still get erased
every time I refresh the workbook. The really frustrating part is that it
only happens for these two named ranges, which only affect one chart.
Everything else runs perfectly.

Any idea what is going on here? I don't have much hair left to rip out..
TIA


--

Dave Peterson


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com