Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Deleting Multiple Names

I have acquired a spreadsheet that has been used for many different
applications by many people. Consequently, several hundred names have been
applied to cells and/or references to other spreadsheets. Each time I creat a
copy of one of the worksheets, a dialogue box appears asking me if I want to
keep or rename the name that has been applied to cells in the sheet. I have
to either hit OK or rename all of them.

What I want to do is delete ALL of the names and start with a clean sheet
each time I copy it. It's very cumbersome deleting them one at a time in the
INSERT - NAME - DEFINE box.

How can I perform a MASS Name Delete?

Thanks.........TC
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default Deleting Multiple Names

Hi

You can remove all names in the active workbook with this workbook.

Sub RemoveNames()
For Each n In ActiveWorkbook.Names
n.Delete
Next
End Sub

To inser the code:
Alt+F11 to open the VBA editor
Goto Insert Module
Copy the above code to the code sheet
Run the macro.

Hopes this helps.

---
Per

"TomCat" skrev i meddelelsen
...
I have acquired a spreadsheet that has been used for many different
applications by many people. Consequently, several hundred names have been
applied to cells and/or references to other spreadsheets. Each time I
creat a
copy of one of the worksheets, a dialogue box appears asking me if I want
to
keep or rename the name that has been applied to cells in the sheet. I
have
to either hit OK or rename all of them.

What I want to do is delete ALL of the names and start with a clean sheet
each time I copy it. It's very cumbersome deleting them one at a time in
the
INSERT - NAME - DEFINE box.

How can I perform a MASS Name Delete?

Thanks.........TC


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Deleting Multiple Names

Thanks for the reply, Per. I tried it and got an error on the n.Delete.

Sub RemoveNames()
For Each n In ActiveWorkbook.Names
n.Delete <------------error
Next
End Sub

"Per Jessen" wrote:

Hi

You can remove all names in the active workbook with this workbook.

Sub RemoveNames()
For Each n In ActiveWorkbook.Names
n.Delete
Next
End Sub

To inser the code:
Alt+F11 to open the VBA editor
Goto Insert Module
Copy the above code to the code sheet
Run the macro.

Hopes this helps.

---
Per

"TomCat" skrev i meddelelsen
...
I have acquired a spreadsheet that has been used for many different
applications by many people. Consequently, several hundred names have been
applied to cells and/or references to other spreadsheets. Each time I
creat a
copy of one of the worksheets, a dialogue box appears asking me if I want
to
keep or rename the name that has been applied to cells in the sheet. I
have
to either hit OK or rename all of them.

What I want to do is delete ALL of the names and start with a clean sheet
each time I copy it. It's very cumbersome deleting them one at a time in
the
INSERT - NAME - DEFINE box.

How can I perform a MASS Name Delete?

Thanks.........TC



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Deleting Multiple Names

Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names
If nme.Name Like "*_FilterDatabase" Or _
nme.Name Like "*Print_Area" Or _
nme.Name Like "*Print_Titles" Or _
nme.Name Like "*wvu.*" Or _
nme.Name Like "*wrn.*" Or _
nme.Name Like "*!Criteria" Then
Else
nme.Delete
End If
Next nme

End Sub

--
__________________________________
HTH

Bob

"TomCat" wrote in message
...
I have acquired a spreadsheet that has been used for many different
applications by many people. Consequently, several hundred names have been
applied to cells and/or references to other spreadsheets. Each time I
creat a
copy of one of the worksheets, a dialogue box appears asking me if I want
to
keep or rename the name that has been applied to cells in the sheet. I
have
to either hit OK or rename all of them.

What I want to do is delete ALL of the names and start with a clean sheet
each time I copy it. It's very cumbersome deleting them one at a time in
the
INSERT - NAME - DEFINE box.

How can I perform a MASS Name Delete?

Thanks.........TC



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Deleting Multiple Names

Only problem is that there are a couple of hundred names in this sheet and
all are different names. I would have to list all of the names to do the
macro below. Is there some way to just delete all the names without listing
each one? Mass delete of n...? The sheet is formatted very intricately and
I'm trying to keep from recreating it several times in new workbooks (which
would solve the problem...).

"Bob Phillips" wrote:

Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names
If nme.Name Like "*_FilterDatabase" Or _
nme.Name Like "*Print_Area" Or _
nme.Name Like "*Print_Titles" Or _
nme.Name Like "*wvu.*" Or _
nme.Name Like "*wrn.*" Or _
nme.Name Like "*!Criteria" Then
Else
nme.Delete
End If
Next nme

End Sub

--
__________________________________
HTH

Bob

"TomCat" wrote in message
...
I have acquired a spreadsheet that has been used for many different
applications by many people. Consequently, several hundred names have been
applied to cells and/or references to other spreadsheets. Each time I
creat a
copy of one of the worksheets, a dialogue box appears asking me if I want
to
keep or rename the name that has been applied to cells in the sheet. I
have
to either hit OK or rename all of them.

What I want to do is delete ALL of the names and start with a clean sheet
each time I copy it. It's very cumbersome deleting them one at a time in
the
INSERT - NAME - DEFINE box.

How can I perform a MASS Name Delete?

Thanks.........TC






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Deleting Multiple Names

No you don't, that is an exclusion list to avoid deleting system generated
names.

--
__________________________________
HTH

Bob

"TomCat" wrote in message
...
Only problem is that there are a couple of hundred names in this sheet and
all are different names. I would have to list all of the names to do the
macro below. Is there some way to just delete all the names without
listing
each one? Mass delete of n...? The sheet is formatted very intricately
and
I'm trying to keep from recreating it several times in new workbooks
(which
would solve the problem...).

"Bob Phillips" wrote:

Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names
If nme.Name Like "*_FilterDatabase" Or _
nme.Name Like "*Print_Area" Or _
nme.Name Like "*Print_Titles" Or _
nme.Name Like "*wvu.*" Or _
nme.Name Like "*wrn.*" Or _
nme.Name Like "*!Criteria" Then
Else
nme.Delete
End If
Next nme

End Sub

--
__________________________________
HTH

Bob

"TomCat" wrote in message
...
I have acquired a spreadsheet that has been used for many different
applications by many people. Consequently, several hundred names have
been
applied to cells and/or references to other spreadsheets. Each time I
creat a
copy of one of the worksheets, a dialogue box appears asking me if I
want
to
keep or rename the name that has been applied to cells in the sheet. I
have
to either hit OK or rename all of them.

What I want to do is delete ALL of the names and start with a clean
sheet
each time I copy it. It's very cumbersome deleting them one at a time
in
the
INSERT - NAME - DEFINE box.

How can I perform a MASS Name Delete?

Thanks.........TC






  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Deleting Multiple Names - Bob Phillips

Bob, I've a similar situation where I was pulling a lookup table from one spreadsheet to another. It was riddled with NAME references. I got tired of looking at it and found your post.

This worked like a charm!

Thanks very much for your post.



Bob Phillips wrote:

Deleting Multiple Names
19-Feb-09

Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names
If nme.Name Like "*_FilterDatabase" Or _
nme.Name Like "*Print_Area" Or _
nme.Name Like "*Print_Titles" Or _
nme.Name Like "*wvu.*" Or _
nme.Name Like "*wrn.*" Or _
nme.Name Like "*!Criteria" Then
Else
nme.Delete
End If
Next nme

End Sub

--
__________________________________
HTH

Bob

"TomCat" wrote in message
...

EggHeadCafe - Software Developer Portal of Choice
WPF And The Model View View Model Pattern
http://www.eggheadcafe.com/tutorials...l-view-vi.aspx
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
Deleting duplicate names law Excel Discussion (Misc queries) 4 December 4th 07 10:52 PM
deleting names from the name box Amy C Excel Discussion (Misc queries) 4 May 12th 06 11:00 AM
deleting duplicate names torbau Excel Discussion (Misc queries) 0 March 8th 06 04:59 PM
deleting duplicate names chris Excel Worksheet Functions 1 February 16th 06 08:42 PM
deleting worksheets from names in a range Jenn Excel Discussion (Misc queries) 2 August 23rd 05 12:00 AM


All times are GMT +1. The time now is 03:25 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"