How do I delete my CC box?

Delete single name from name box

  • QUESTION: I found the following macro or code on your site: Executeexcel4macro"SUM(DELETE.NAME(NAMES()))" This will delete all names in my name box. It works fine. What is the code for deleting only one name? I'm working in2000. ANSWER: * Wow, that is old stuff right there...I am really unsure of how to answer your question, other than the best advice I can give you is don't use that code. It's older than abraham and won't be supported as soon as you move to2003 (or later). Why not just write some decent, raw vba code. I would not use that 'executeexcel4macro'. I've barely heard of it. Here is an example, and I am fairly sure this will work in2000, it works in Excel 2003. Sub DeleteName() ActiveWorkbook.Names("NameOftheNamedRange").Delete End Sub Or, if you want to allow user to specify it each time, here is a well written set of code complete with errhandling, to give the user a real nice result, if they type a non-existent name. Sub DeleteName() On Error GoTo errhandler Dim myname As String myname = InputBox("Enter name of name to delete") ActiveWorkbook.Names(myname).Delete Exit Sub errhandler: If InStr(Err.Description, "Application-defined") > 0 Then MsgBox "Name not found", vbCritical, " " Exit Sub Else MsgBox "The following error has occurred" & vbNewLine & vbNewLine & "Error #: " & Err.Number _ & vbNewLine & "Error Description: " & Err.Description, vbCritical, " " End If Exit Sub End Sub ---------- FOLLOW-UP ---------- QUESTION: I'm a novice. With the workbook open, I hit Alt-F11 followed by CTRL-G. That opened my Immediate Pane. I typed in the first answer you gave me, the three line code, substituting the name in the name box that I wanted to delete, and hit enter. I got a box that said: Compile Error: Invalid in Immediate Pane. I clicked on Help and got some stuff that I didn't really understand. I played around a little bit, but nothing worked. What am I doing wrong? If you don't wnat to waste your time on somebody who doesn't really know what he's doing, I'll understand.

  • Answer:

    Mostly the problem is just that I don't have2000 so I'm not sure how the screens look. I know in Excel 2003 OR2007, you would do this: Get to the visual basic editor (easiest/surest way is right click on sheet tab name, View Code). Then up at the top, go to Insert, Module. Inside the module, copy/paste in the code that I gave. Sub DeleteName() On Error GoTo errhandler Dim myname As String myname = InputBox("Enter name of name to delete") ActiveWorkbook.Names(myname).Delete Exit Sub errhandler: If InStr(Err.Description, "Application-defined") > 0 Then MsgBox "Name not found", vbCritical, " " Exit Sub Else MsgBox "The following error has occurred" & vbNewLine & vbNewLine & "Error #: " & Err.Number _ & vbNewLine & "Error Description: " & Err.Description, vbCritical, " " End If Exit Sub End Sub By the way, there is a thing called Microsoft OfficeBlue edition. You can google it for more information, and I'm kind of stepping out on a limb here because I know some would look down on me recommending this. It's a version you don't have to pay for, to put it bluntly. I didn't believe it until someone gave me a CD with it. Long story short, it is just a hackers group who found a way to release the "real" (not a copy, mimic, close imitation, but it actually is Office) version, without needing a product activation key. I couldn't find a way to readily download it without joining a Torrent group, so I bought it off someone on craiglist (they burned it to a CD), for $20...just to check it out. I hypothetically may have installed it on my home pc, and it hypothetically may have installed and works perfectly. No time limitations, no activation key, the real Office. I may hypothetically now have Access, Excel,and Outlook..... I'm only bringing this up because I consider myself a bit of an expert in most Office apps, but I only found out about this a couple months ago and am quite intrigued by the whole thing, and impressed that it was "true". Of course, I can never go on record as recommending that anything not legal be done. though I'm not sure this would be 'illegal' in the first place, it is so widely out there on the Internet. I can only say, it's actually getting very widely used, and it really IS office, so there's nothing dangerous about it. The part of the software that requires the activation key has just been removed. I can say many people are using it now. And you have got to be suffering with2000.

Miningco.com Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.