Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting named ranges by looping through range collection

How could I delete all the named ranges from a workbook using VB
looping procedures and not individually going through each one of the
from the front end worksheets.

Do we have a range collection as we have collections for other object
like worksheets and workbooks etc?

Best regards and Thanks

Deepa

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Deleting named ranges by looping through range collection

Do you want to:

a. delete the ranges;

b. delete the contents of the ranges; or

c. simply delete the range names?

If you want c., try something like:

Sub DeleteRangeNames()
Dim nm As Name, rng As Range
For Each nm In Names
On Error Resume Next
Set rng = Range(nm)
On Error GoTo 0
If Not rng Is Nothing Then nm.Delete
Set rng = Nothing
Next
End Sub

--

Vasant

"agarwaldvk " wrote in message
...
How could I delete all the named ranges from a workbook using VBA
looping procedures and not individually going through each one of them
from the front end worksheets.

Do we have a range collection as we have collections for other objects
like worksheets and workbooks etc?

Best regards and Thanks

Deepak


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting named ranges by looping through range collection

Thanks Vasant.

I think what you have provided is what I want. In essence, what
wanted was that these superfluous range names no longer appear in th
names list box at the top left corner of the workbook window.
certainly didn't want the range or the contents of the range deleted.

So, thanks again for correctly guessing what I wanted and the
providing the solution too.

Best regards


Deepa

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Deleting named ranges by looping through range collection

I'd get a copy of Jan Karel Pieterse's (with Charles Williams and Matthew
Henson) Name Manager.

You can find it at:
NameManager.Zip from http://www.bmsltd.ie/mvp

If you use names a lot, you'll find it very, very useful.

"agarwaldvk <" wrote:

How could I delete all the named ranges from a workbook using VBA
looping procedures and not individually going through each one of them
from the front end worksheets.

Do we have a range collection as we have collections for other objects
like worksheets and workbooks etc?

Best regards and Thanks

Deepak

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

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 Named Ranges Carl Excel Worksheet Functions 2 August 31st 06 07:16 PM
Deleting many named ranges Tom Hayakawa Excel Worksheet Functions 2 March 28th 05 10:47 PM
Looping through named ranges Tim[_38_] Excel Programming 1 May 10th 04 07:20 PM
Looping thru cells in a named range Michael Beckinsale Excel Programming 4 September 2nd 03 02:07 PM
looping cells though a named range Jo[_4_] Excel Programming 1 August 20th 03 12:32 AM


All times are GMT +1. The time now is 11:19 PM.

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

About Us

"It's about Microsoft Excel"