LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Deleting Named Ranges

Hi

I hope someone can help me ou there. I'm trying to delete all named ranges
in all Worksheets, except one named "Connection Data", but I don't seem to
having any success. I have pasted my code below. If anyone can enlighten me
as to where I'm going wrong, it would be much appreciated.

Many Thanks - Grant

Sub DeleteRanges()
Dim WSh As Worksheet
Dim nm As Name

'----------------------------
'Delete All Named Ranges Except Named Ranges "In Connection Data" Workbook
'----------------------------

For Each WSh In ThisWorkbook.Worksheets
If Not WSh.Name Like "Connection Data" Then
For Each nm In ActiveWorkbook.Names
nm.Delete
Next nm
End If
Next WSh

End Sub


 
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 all named ranges that have a workbook scope Babymech Excel Discussion (Misc queries) 3 February 19th 09 04:21 PM
deleting multiple named ranges april Excel Discussion (Misc queries) 1 April 15th 08 07:03 PM
problem in deleting the named ranges Maya[_2_] Excel Worksheet Functions 1 June 28th 07 12:52 PM
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


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