Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default problem in deleting the named ranges

Can anyone please let me know how to delete the named ranges of those
worksheets which have been deleted from the workbook.I have noticed that when
we delete the sheets, named ranges referening to those sheets donot get
deleted cos of this the size of the workbook gets increase .Is there any
event which will fire while deleting the sheet from the workbook.

thanksin advance for any of the suggestion.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default problem in deleting the named ranges

Try this:-

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim nName As Name
For Each nName In Names
If InStr(1, nName.RefersTo, "#REF!") 0 Then
nName.Delete
End If
Next nName
End Sub

Mike

"Maya" wrote:

Can anyone please let me know how to delete the named ranges of those
worksheets which have been deleted from the workbook.I have noticed that when
we delete the sheets, named ranges referening to those sheets donot get
deleted cos of this the size of the workbook gets increase .Is there any
event which will fire while deleting the sheet from the workbook.

thanksin advance for any of the suggestion.

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
Problem with Dynamic Named Ranges Andibevan Excel Worksheet Functions 4 October 5th 05 12:56 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
Deleting many named ranges Tom Hayakawa Excel Worksheet Functions 2 March 28th 05 10:47 PM
Problem Working with Named Ranges montgomerymouse Excel Discussion (Misc queries) 1 January 10th 05 10:45 PM


All times are GMT +1. The time now is 02:30 AM.

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"