PC Review


Reply
Thread Tools Rate Thread

Delete all Range Names Except for 1 Q

 
 
Sean
Guest
Posts: n/a
 
      16th Jan 2007
I have the following code which deletes all Range Names in a Workbook.
How would I delete all except for 1 Range Name called "MyUsers"

For Each nName In ActiveWorkbook.Names
nName.Delete
Next


Thanks

 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      16th Jan 2007
For Each nName In ActiveWorkbook.Names
If nName.Name <> "MyUsers" Then
nName.Delete
End If
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Sean" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have the following code which deletes all Range Names in a Workbook.
> How would I delete all except for 1 Range Name called "MyUsers"
>
> For Each nName In ActiveWorkbook.Names
> nName.Delete
> Next
>
>
> Thanks
>



 
Reply With Quote
 
Sean
Guest
Posts: n/a
 
      16th Jan 2007
Thanks Jon

Jon Peltier wrote:
> For Each nName In ActiveWorkbook.Names
> If nName.Name <> "MyUsers" Then
> nName.Delete
> End If
> Next
>
> - Jon
> -------
> Jon Peltier, Microsoft Excel MVP
> Tutorials and Custom Solutions
> http://PeltierTech.com
> _______
>
>
> "Sean" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I have the following code which deletes all Range Names in a Workbook.
> > How would I delete all except for 1 Range Name called "MyUsers"
> >
> > For Each nName In ActiveWorkbook.Names
> > nName.Delete
> > Next
> >
> >
> > Thanks
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


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 Microsoft Excel Misc 2 4th Nov 2009 08:32 PM
Delete all Range Names Q Seanie Microsoft Excel Programming 5 11th Jan 2009 08:35 PM
delete non-used range names =?Utf-8?B?VHhSYWlzdGxpbg==?= Microsoft Excel Programming 3 19th Jul 2006 09:05 AM
Delete Specific Range Names Larry Microsoft Excel Programming 3 22nd Dec 2003 09:48 PM
How do I delete ExternalRata range names? Nathan Gutman Microsoft Excel Programming 2 18th Dec 2003 09:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:54 PM.