Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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
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
Defined Names in Workbook Beaniecounter Excel Worksheet Functions 3 January 18th 08 09:30 PM
Tranferring names defined in one excel workbook to another workboo Dinesh Excel Discussion (Misc queries) 1 July 1st 06 05:34 AM
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
Correct way to use names defined globally in a workbook, in VBA packat[_2_] Excel Programming 9 January 1st 05 08:30 PM


All times are GMT +1. The time now is 09:33 PM.

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

About Us

"It's about Microsoft Excel"