Many of my files contain 11,990 named ranges in the name manager. All of them are #REF! and useless. Most of our files are based on templates that contain these named ranges, so all of the files I work in have thousands of named ranges that slow the program and slow down writing formulas (thanks to whatever jerk decided "sum", "sum1", "sum2", etc. were good names for ranges lol). When I try to open the name manager in the Formulas ribbon menu, the cursor wheel spins a while, then nothing happens. On rare occasions, the name manager does open, and I can delete them all, but I have not been able to figure out why that occasionally happens.
I tried writing a macro (below) and receive "runtime error 7: out of memory".
Sub DeleteNames()
Dim nm as Name
For Each nm In ActiveWorkbook.Names
nm.Delete
Next nm
End Sub
I can open the names in the browser version of excel, but I cannot select and delete more than one name at a time in that view - I can't delete 12k names one-by-one. Is there else I can try?
Using -> Microsoft® Excel® for Microsoft 365 MSO (Version 2501 Build 16.0.18429.20132) 64-bit