Hi all,
I currently have a workbook with over 1000 names defined and I would like to delete all of them at once. I have searched around and tried to use the following macro:
Sub DelNames()
For Each nm In ActiveWorkbook.Names
nm.delete
Next nm
End Sub
However, when I try to run it, I get a runtime error 1004: the name is not valid and it highlights nm.delete.
What am I doing wrong??? I have more than 1 workbook that I need to delete names in and it is a pain to go and delete each one manually.
Help!
Thanks
I currently have a workbook with over 1000 names defined and I would like to delete all of them at once. I have searched around and tried to use the following macro:
Sub DelNames()
For Each nm In ActiveWorkbook.Names
nm.delete
Next nm
End Sub
However, when I try to run it, I get a runtime error 1004: the name is not valid and it highlights nm.delete.
What am I doing wrong??? I have more than 1 workbook that I need to delete names in and it is a pain to go and delete each one manually.
Help!
Thanks