replace names

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Excel 2002

Trying to delete unused names in a workbook as follows:

'update the range variable names
For Each w In ActiveWorkbook.Names
If w <> "" Then
w.Delete
End If
Next w

However, this faults on w.delete everytime.

Any thoughts?

Thanks,

Jason
 
The default property of a name object is the name, so it will always not
equal ""

Your whole concept is a little hard to understand. What do you mean by an
unused name?
 
Sorry, I am actually deleting all names in a workbook prior to reading in new
data and defining new names. Turned out my issue was the varible names being
imported rather than the code itself, as it works just fine now.

Thanks,

Jason
 

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