ActiveWorkbook.Names rogue entries

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
I have code

Set nms = ActiveWorkbook.Names
For Each c In nms

and get a c.name="'Sheet4'!_Regression_Int"

Note that this means it's a "sheet-local" defined name. _Regression_Int isn't even in google, which signifies Armageddon, AFAIC. Other ones are
"'Sheet4'!ALR"
"'Sheet4'!ALRN"
"'Sheet4'!ANTLRN"

I'm assuming that these are not part of Excel; thus a prior user must have created them. I'd like to strip them out. Apparently they're unused.

However they're not in (insert/names/define) list - even though Sheet4 is active. I can't even see them, much less delete them. What am I missing here?

** EDIT 9-28-06: ALR, ALRN and ANTLRN are in fact in the define list, but not _Regression_Int. My bad **
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
Hi Gates,
Try this on a blank sheet and see if it tells you where the range(s) is/are.
Code:
[a1].ListNames

Any ranges not desired should be able to be deleted with more code. (And I guess you don't
really need to know where they are for that if you know their names.
 

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
Thanks for the suggestion. No, they're not in [a1].ListNames.

Sure, I can terminate them from the code (although, not exactly effortlessly) ... but I still don't get what's going on here. They're little mysterious Underwear Gnomes that only appear when you're not looking. I wish I knew how they got there, and where are they seen in the Excel non-VBA interface.
 

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
Foolish me - half foolish anyway. I actually did go to a blank sheet (thank you for the thoughtfulness, since A1:B?? gets overwritten :) :) ). Local defined ranges would be invisible there anyway.

But if I actually go to Sheet4, _Regression_Int is not found by either .Listnames or alt-I/N/D. Maybe the leading underscore means it's an internal variable?
 

Forum statistics

Threads
1,141,626
Messages
5,707,483
Members
421,510
Latest member
haroonstr

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
Top