Removing unused named ranges

Tkeller

Board Regular
Joined
Jul 23, 2003
Messages
143
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have inherited a massive file and have eliminated several worksheets. Now, I would like to clean up the workbook. Of the hundereds of named ranges, only a fraction of them are now in use. Is there an easy way, to determine which ones are no longer in use and delete them?

Much thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
you can use Excel's Find Feature....

edit - find

enter the range name

under options, have it lookin WORKBOOK

click FIND ALL

if none are found then there are no formulas referring to it....

then do the same in VBA to see if there is any references to it in VBA code..

open VBA window - (right click excel icon in top left corner - view code)
Edit - Find

Select "CURRENT PROJECT"

that will find any references to that range name in the VBA code.


of coarse, depending on the names, it may take some logical guesswork on your part to figure out which ones are Named Range References, and which ones are just words meant to stand for something else...
 
Upvote 0
I think that any sheet deleted also deletes his child names. So your problem is to find which names in remaining sheets are not used. In that case namemanager as richard suggested will be extremely useful. But to rebuild the book is the best way so avoid leftovers and cleanup the mess. Also take a look at VBA code cleaner add-in; if someone could help on this.. i do not remember where i've downloaded this from.
 
Upvote 0
(snip)you can use Excel's Find Feature....

edit - find

enter the range name

under options, have it lookin WORKBOOK

click FIND ALL

if none are found then there are no formulas referring to it....

(snip)

Be a little careful with this one, jonmo...just because there isn't a formula referencing the named range doesn't mean that it's not used. As one example, if you set up data validation to allow a named range as the list source, its use in data validation will not be picked up by Excel Find.
 
Upvote 0
I think that any sheet deleted also deletes his child names. So your problem is to find which names in remaining sheets are not used. In that case namemanager as richard suggested will be extremely useful. But to rebuild the book is the best way so avoid leftovers and cleanup the mess. Also take a look at VBA code cleaner add-in; if someone could help on this.. i do not remember where i've downloaded this from.


Would that be this one Kostas?

http://www.appspro.com/Utilities/CodeCleaner.htm
 
Upvote 0
Thanks

That tool is awesome.

Wish I had known about this before.
 
Upvote 0

Forum statistics

Threads
1,222,554
Messages
6,166,761
Members
452,069
Latest member
myanis72

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