Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default delete non-used range names

I have an excel 2003 file with multiple sheets, and hndreds of named range
referring to both single cells or ranges. I have renamed some ranges but the
old names persist. I know I could just delete all of the names in a workbook
and I have the code for that, but how would i check to see if a range name is
used anywhere, and if not then delete it?

Appreciate any help as always,

Jason
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default delete non-used range names

Jason,
This may help to list all the names:
http://j-walk.com/ss/excel/files/namelist.htm

As for seeing which are referenced, I suppose you have a few option;
- .Find through all formulae on all sheets to see if "RangeName" is used.
- Use something based on Auditing, maybe see if this fails:
Range("RangeName").NavigateArrow(True,1).Select

Obviously neither will tell you if VBA code uses any of the names. You would
have use the VBE and search the code for instances of the name.
http://www.cpearson.com/excel/vbe.htm

NickHK

"TxRaistlin" wrote in message
...
I have an excel 2003 file with multiple sheets, and hndreds of named range
referring to both single cells or ranges. I have renamed some ranges but

the
old names persist. I know I could just delete all of the names in a

workbook
and I have the code for that, but how would i check to see if a range name

is
used anywhere, and if not then delete it?

Appreciate any help as always,

Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default delete non-used range names

Jason,
Something like:
Dim DependentCount as Long
On Error Resume Next
DependentCount=Range("RangeName).Dependents.Count
If DependentCount=0 Then
'Name not used on same sheet
End If
DependentCount=0

This does not seem to include dependents on other sheets, so for that you
may have to resort to .navigatearrow etc.

NickHK

"TxRaistlin" wrote in message
...
I have an excel 2003 file with multiple sheets, and hndreds of named range
referring to both single cells or ranges. I have renamed some ranges but

the
old names persist. I know I could just delete all of the names in a

workbook
and I have the code for that, but how would i check to see if a range name

is
used anywhere, and if not then delete it?

Appreciate any help as always,

Jason



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default delete non-used range names

Hi Jason,

To find if a Name is used in cell formulas, chart (series, titles etc),
'linked' in a textbox, in vba code in any open accessible project, and
various other places, and report such locations is virtually impossible.
Luckily all that and much more has been virtually done!

Get hold of the NameManager addin which you can get from the authors' sites
of Jan Karel Pieterse and Charles Williams (download sections).

www.jkp-ads.com
www.DecisionModels.com

This is a new version, I did notice one or two minor bugs which I have no
doubt will be fixed soon. But it's a must have if you work extensively with
Names.

Regards,
Peter T



"TxRaistlin" wrote in message
...
I have an excel 2003 file with multiple sheets, and hndreds of named range
referring to both single cells or ranges. I have renamed some ranges but

the
old names persist. I know I could just delete all of the names in a

workbook
and I have the code for that, but how would i check to see if a range name

is
used anywhere, and if not then delete it?

Appreciate any help as always,

Jason



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Delete blanks between a range and populate only the names inthe given range Yuvraj Excel Discussion (Misc queries) 2 November 4th 09 08:32 PM
How to delete a hundred range names at once? Dima Excel Worksheet Functions 4 August 7th 08 11:26 AM
not delete worksheets from names in a range DARREN FONG Excel Discussion (Misc queries) 3 November 11th 05 05:31 PM
Delete Specific Range Names Larry[_11_] Excel Programming 3 December 22nd 03 09:48 PM
How do I delete ExternalRata range names? Nathan Gutman Excel Programming 2 December 18th 03 09:02 PM


All times are GMT +1. The time now is 07:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"