Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default delete name range

Hi

I defined ranges (Insert Names Define). Now I want to delete the
reference with vba and keep the content of the cells, but I don't now how.

thanks a lot for help
masterphilch
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default delete name range

as example for a defined range with name "Name1"
ActiveWorkbook.Names("Name1").Delete

or to remove all names

Dim nm as Name
for each nm in Activeworkbook.Names
nm.Delete
Next

These are deleting the name definition, not the range they refer to.

--
Regards,
Tom Ogilvy


"masterphilch" wrote in message
...
Hi

I defined ranges (Insert Names Define). Now I want to delete the
reference with vba and keep the content of the cells, but I don't now how.

thanks a lot for help
masterphilch



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default delete name range

thanks!
It seems I've got a little different problem. My defined names are
sepcified for only one worksheet. They are generated by a sql-query.
It would be nice if you could help me again! Do I perhaps have to change
some parameters in my query (shown below)?

..name = "mitglieder_von_vka_tool"
..FieldNames = True
..RowNumbers = False
..FillAdjacentFormulas = False
..PreserveFormatting = True
..RefreshOnFileOpen = False
..BackgroundQuery = True
..RefreshStyle = xlInsertDeleteCells
..SavePassword = False
..SaveData = False
..AdjustColumnWidth = True
..RefreshPeriod = 0
..PreserveColumnInfo = True
..Refresh BackgroundQuery:=False

thanks

Tom Ogilvy wrote:
as example for a defined range with name "Name1"
ActiveWorkbook.Names("Name1").Delete

or to remove all names

Dim nm as Name
for each nm in Activeworkbook.Names
nm.Delete
Next

These are deleting the name definition, not the range they refer to.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default delete name range

I don't think you want to delete the names if the query exists.

In any event, now I am not sure what you are asking.

--
Regards,
Tom Ogilvy

"masterphilch" wrote in message
...
thanks!
It seems I've got a little different problem. My defined names are
sepcified for only one worksheet. They are generated by a sql-query.
It would be nice if you could help me again! Do I perhaps have to change
some parameters in my query (shown below)?

.name = "mitglieder_von_vka_tool"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = False
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False

thanks

Tom Ogilvy wrote:
as example for a defined range with name "Name1"
ActiveWorkbook.Names("Name1").Delete

or to remove all names

Dim nm as Name
for each nm in Activeworkbook.Names
nm.Delete
Next

These are deleting the name definition, not the range they refer to.



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
How to Delete blanks between a range and populate only the names inthe given range Yuvraj Excel Discussion (Misc queries) 2 November 4th 09 08:32 PM
delete a range The Weather Girl Excel Worksheet Functions 4 July 13th 09 03:51 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
Delete range gavmer[_42_] Excel Programming 1 June 30th 04 07:24 AM
DELETE RANGE NAME gus Excel Programming 3 September 23rd 03 07:25 AM


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