quick names removal before sheet move

J

Jose Mourinho

I regularly copy a particular sheet over to another workbook, but have to
click away a multitude of Names in that sheet when prompted by Excel (i.e.
whether to copy the names over to the new workbook or not). Is not my sheet,
so cannot have the Names permanantly removed unfortunately. Is a tedious
process...I would love to have a 'Ignore all' button (maybe one day eh?).

Anyone know a quick way to avoid all this clicking?

JM
 
G

Gary''s Student

Try this little macro:

Sub NameDropper()
n = ActiveWorkbook.Names.Count
For i = n To 1 Step -1
ActiveWorkbook.Names(i).Delete
Next
End Sub
 
D

Don Guillett

If you guessed correctly that OP wants to remove "names" then this will also
work

for each n in activeworkbook.names
n.delete
next n
 
Top