delete name range

  • Thread starter Thread starter masterphilch
  • Start date Start date
M

masterphilch

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
 
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.
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top