Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting unused Defined Names in a workbook?
I am trying to write a macro to delete the unused defined names in a
workbook. I am looking for a way to test if the name is used in the workbook somewhere and if it is a print area... I was hoping to come up with some sort of if statement to accomplish this and put it below in the [New Code] placeholder. Thanks for the help. Sub DeleteNames() ' ' DeleteNames Macro ' Macro Written 5/12/2005 by MRP ' Dim rng As Range Dim ThisName As Name Msg = "This Macro will delete all unused Defined Names in this workbook. Are you sure you wish to proceed?" Ans = MsgBox(Msg, vbYesNo) If Ans = vbYes Then For Each ThisName In ActiveWorkbook.Names [New Code] ThisName.Delete Next ThisName End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Defined Names in Workbook | Excel Worksheet Functions | |||
Tranferring names defined in one excel workbook to another workboo | Excel Discussion (Misc queries) | |||
How to delete all defined names from a workbook? | Excel Worksheet Functions | |||
How to delete all defined names from a workbook? | Links and Linking in Excel | |||
Correct way to use names defined globally in a workbook, in VBA | Excel Programming |