M
Mike Piazza
I have have the below as a start on my why to writing a macro to delete
unused defined names from a workbook. MY question is can a place an if
statement where the [New Code] placeholder is to test if the name is
currently used in the workbook or refers to a print area? 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 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
unused defined names from a workbook. MY question is can a place an if
statement where the [New Code] placeholder is to test if the name is
currently used in the workbook or refers to a print area? 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 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