Excel: named ranges 'missing' after macro copy sheet

donalde

Board Regular
Joined
Feb 27, 2002
Messages
80
Hi all

I have encountered strange problem with named ranges, some named ranges are visible in navigation, but others are not. All named ranges are scoped to workbook (according name manager).

What leads to this? I have excel template with named ranges, to this template executable VB.NET code send lot of values via VBA macro. After executable has finished macro calls, excel template is show to user with values visible, cells formatted and named ranges in use. After this has some things to do, one of those is to press button which saves some parts of generated excel to network drive. On this save half of sheets are copy pasted to new workbook and this new workbook is saved and closed.

When this saved workbook is opened, like one third of named ranges are visible in navigation drop down (or name show when going directly to cell). However, if I go to Name Manager, click named range, click Edit, and click Ok, named range becomes visible in navigation, and I can use it on macros and formulas.

When macro creates new workbook it just creates new sheet, names it, and uses VBA's copy / paste for copying.

Can some one please help me to determine how to fix this, or at least give work around.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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