Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

I need to remove items from a list box in Excel, referencing these items by name- not index location. Can I?

I populate a list based on check boxes on a previous page of a dialog box. When someone unchecks a box, i need that part of the list to go away, but I don't want the rest of the entries to be deleted. The list changes all the time, so I can't really reference an index (unless anyone knows some way that I can). Is there any way to delete items by name?

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    uhm, if i understand what you mean, you are in VBA?

    if this is the case, in the code for the checkbox you have your code right now which might look like

    if checkbox1 = true then

    Range("A1").formular1c1 = "this text"

    End if

    i dono if thats what you have, just an example.

    so then what you can do is under that add this

    if Checkbox1 = false then

    Range("A1").clearcontents

    end if

    this way it will put the info in if it is true, and take it out if it is false.

    this code wasnt tested, dont have excel on this computer.

    hope it works :)

Still have questions? Get your answers by asking now.