LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Macro to delete Defined Names

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete defined names beata Excel Discussion (Misc queries) 1 January 7th 08 09:44 PM
unable to delete Macro names George P Excel Discussion (Misc queries) 1 January 28th 07 10:17 PM
How to delete all defined names from a workbook? Dmitry Kopnichev Excel Worksheet Functions 15 November 14th 05 03:26 PM
How to delete all defined names from a workbook? Dmitry Kopnichev Links and Linking in Excel 15 November 14th 05 03:26 PM
Macro to Finded Defined Names with #REF Kay[_3_] Excel Programming 1 January 6th 04 05:34 PM


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"