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: 1
Default Delete all named ranges in a workbook

Hi All

I've obviously missing something here and would appreciate any help.
I've seen a few similar threads but they haven't helped ....

I have an excel 97 workbook with a series of named ranges and would
like to delete them all. I'm suring the code ...

Sub a()


Worksheets(1).Select

For i = 1 To Worksheets.Count

Worksheets(i).Select

For n = 1 To ActiveSheet.Names.Count
strNAME = ActiveSheet.Names(n).Name
ActiveSheet.Names(n).Delete
Next n

n = 1
Worksheets(i).Select

Next i



End Sub

.... however when I run this code I keep getting error 9 from the
subscript being out of range.

I'm sure I'm making a simple mistake...

Thanks in advance

Cheers
Bevan

 
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
Delete unnecessary Named Ranges berniean Excel Discussion (Misc queries) 1 August 27th 09 07:24 PM
duplicate named ranges- how to detect, delete? Keith R Excel Discussion (Misc queries) 2 June 1st 07 04:41 PM
macro to delete all named ranges in a workbook en masse? Dave F Excel Discussion (Misc queries) 1 November 3rd 06 09:17 PM
Delete named ranges beginning with a string GoFigure[_7_] Excel Programming 2 December 4th 05 12:23 PM
Delete LOCAL named ranges Greg Excel Programming 2 December 9th 04 03:20 AM


All times are GMT +1. The time now is 10:20 PM.

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"