Delete all Range Names Except for 1 Q

S

Sean

I have the following code which deletes all Range Names in a Workbook.
How would I delete all except for 1 Range Name called "MyUsers"

For Each nName In ActiveWorkbook.Names
nName.Delete
Next


Thanks
 
J

Jon Peltier

For Each nName In ActiveWorkbook.Names
If nName.Name <> "MyUsers" Then
nName.Delete
End If
Next

- Jon
 

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

Top