Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Deleting broken range names

I have a lot of range names in my workbook. After some
time, some of them no longer point anywhere, and I'd like
to delete them. I cannot do this manually since the broken
range names do not show up under Insert/Name/Define. I
would like to write a simple loop that works as follows:
For Each nm In ActiveWorkbook.Names
<If nm is broken then delete nm
Next
Can someone please help me fill in the missing line.

Thanks in advance

Ray Kanner

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting broken range names

For Each nm In ActiveWorkbook.Names
if instr(nm.Refersto,"#") then
nm.Delete
end if
Next

--
Regards,
Tom Ogilvy

"Ray Kanner" wrote in message
...
I have a lot of range names in my workbook. After some
time, some of them no longer point anywhere, and I'd like
to delete them. I cannot do this manually since the broken
range names do not show up under Insert/Name/Define. I
would like to write a simple loop that works as follows:
For Each nm In ActiveWorkbook.Names
<If nm is broken then delete nm
Next
Can someone please help me fill in the missing line.

Thanks in advance

Ray Kanner



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
Deleting invisible range names - how? Kevryl Excel Discussion (Misc queries) 3 June 2nd 10 06:27 AM
Restoring formulas after deleting range names KDJ Excel Worksheet Functions 3 January 2nd 07 06:24 PM
deleting names from the name box Amy C Excel Discussion (Misc queries) 4 May 12th 06 11:00 AM
deleting worksheets from names in a range Jenn Excel Discussion (Misc queries) 2 August 23rd 05 12:00 AM
Adding and deleting Range Names Paul Excel Programming 1 October 1st 03 10:56 AM


All times are GMT +1. The time now is 02:10 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"