Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Removing Names

I made the mistake of writing a procedure that deleted selected sheets in my
workbook. I deleted the sheets without deleting the name cells in that
sheet. Now when I use 'F3' to paste the list of named cells I have about 800
names that don't exist in my workbook. How can I remove these?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Removing Names

On the menu bar...InsertNameDefine... Then select the names you want to
delete and click delete.

"ranswrt" wrote:

I made the mistake of writing a procedure that deleted selected sheets in my
workbook. I deleted the sheets without deleting the name cells in that
sheet. Now when I use 'F3' to paste the list of named cells I have about 800
names that don't exist in my workbook. How can I remove these?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Removing Names

Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names

If Left(nme.RefersTo, 6) = "=#REF!" Then

nme.Delete
End If
Next nme
End Sub

Take a backup before you do this and make sure the others are okay.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ranswrt" wrote in message
...
I made the mistake of writing a procedure that deleted selected sheets in
my
workbook. I deleted the sheets without deleting the name cells in that
sheet. Now when I use 'F3' to paste the list of named cells I have about
800
names that don't exist in my workbook. How can I remove these?
Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Removing Names

Thanks that worked great. I had about 800 names to delete.

I have another question. I am building a workbook with procedures to add,
delete, and modify different databases. The list can grow to be very large.
Is it better, more efficient, and faster to have the list on one sheet or
have each database on its own worksheet that might be deleted when the
database is no longer needed?
Thanks

"Bob Phillips" wrote:

Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names

If Left(nme.RefersTo, 6) = "=#REF!" Then

nme.Delete
End If
Next nme
End Sub

Take a backup before you do this and make sure the others are okay.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ranswrt" wrote in message
...
I made the mistake of writing a procedure that deleted selected sheets in
my
workbook. I deleted the sheets without deleting the name cells in that
sheet. Now when I use 'F3' to paste the list of named cells I have about
800
names that don't exist in my workbook. How can I remove these?
Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Removing Names

I don't know about more efficient, but if they are big lists, it might just
be more manageable visually to have them on separate worksheets.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ranswrt" wrote in message
...
Thanks that worked great. I had about 800 names to delete.

I have another question. I am building a workbook with procedures to add,
delete, and modify different databases. The list can grow to be very
large.
Is it better, more efficient, and faster to have the list on one sheet or
have each database on its own worksheet that might be deleted when the
database is no longer needed?
Thanks

"Bob Phillips" wrote:

Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names

If Left(nme.RefersTo, 6) = "=#REF!" Then

nme.Delete
End If
Next nme
End Sub

Take a backup before you do this and make sure the others are okay.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"ranswrt" wrote in message
...
I made the mistake of writing a procedure that deleted selected sheets
in
my
workbook. I deleted the sheets without deleting the name cells in that
sheet. Now when I use 'F3' to paste the list of named cells I have
about
800
names that don't exist in my workbook. How can I remove these?
Thanks






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
Removing labels and names in formulas Eleazar Excel Discussion (Misc queries) 3 July 11th 06 12:03 AM
Removing range names. Laurence Lombard Excel Discussion (Misc queries) 2 February 28th 06 09:24 AM
Removing Duplcate Names Dave Y Excel Worksheet Functions 4 April 8th 05 06:26 PM
Removing Defined Names John M Excel Programming 3 February 1st 05 11:01 PM
Removing Range Names k9deb Excel Programming 4 July 30th 04 05:50 PM


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