Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Can't delete named ranges?

I have found that you can only have one named range referring to a particular
range. You can add more, but they are not visible or editable in the sheets.

So I am attempting to delete all the names on a worksheet prior to
rebuilding them. I used:

Dim theSheet As Worksheet
Set theSheet = Worksheets("Input")
For Each namedRange In theSheet.Names
theSheet.Names(namedRange.Name).Delete
Next namedRange

When I use this, the code is skipped over as theSheet.Names is empty.
However when I simply click around on the sheet I can see that there are
names there.

Does anyone know why this list appears empty even though there are ranges on
the sheet?

Maury
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Can't delete named ranges?

First, I've used multiple names that point at the same range and had no trouble
seeing them in the Insert|Name|define dialog.

Second, are you sure that the names are worksheet level names--not workbook
level names?

Third, since you're working with names, get Jan Karel Pieterse's (with Charles
Williams and Matthew Henson) Name Manager:

You can find it at:
NameManager.Zip from http://www.oaltd.co.uk/mvp



Maury Markowitz wrote:

I have found that you can only have one named range referring to a particular
range. You can add more, but they are not visible or editable in the sheets.

So I am attempting to delete all the names on a worksheet prior to
rebuilding them. I used:

Dim theSheet As Worksheet
Set theSheet = Worksheets("Input")
For Each namedRange In theSheet.Names
theSheet.Names(namedRange.Name).Delete
Next namedRange

When I use this, the code is skipped over as theSheet.Names is empty.
However when I simply click around on the sheet I can see that there are
names there.

Does anyone know why this list appears empty even though there are ranges on
the sheet?

Maury


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Can't delete named ranges?


try a simpler approach

for each n in sheets("Input").names
n.delete
next n

--
Don Guillett
SalesAid Software

"Dave Peterson" wrote in message
...
First, I've used multiple names that point at the same range and had no
trouble
seeing them in the Insert|Name|define dialog.

Second, are you sure that the names are worksheet level names--not
workbook
level names?

Third, since you're working with names, get Jan Karel Pieterse's (with
Charles
Williams and Matthew Henson) Name Manager:

You can find it at:
NameManager.Zip from
http://www.oaltd.co.uk/mvp



Maury Markowitz wrote:

I have found that you can only have one named range referring to a
particular
range. You can add more, but they are not visible or editable in the
sheets.

So I am attempting to delete all the names on a worksheet prior to
rebuilding them. I used:

Dim theSheet As Worksheet
Set theSheet = Worksheets("Input")
For Each namedRange In theSheet.Names
theSheet.Names(namedRange.Name).Delete
Next namedRange

When I use this, the code is skipped over as theSheet.Names is empty.
However when I simply click around on the sheet I can see that there are
names there.

Does anyone know why this list appears empty even though there are ranges
on
the sheet?

Maury


--

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
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
Delete all named ranges in a workbook [email protected] Excel Programming 3 November 7th 06 09:09 AM
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 09:48 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"