Delete embedded listbox

  • MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question

    1. [Blocked Image: http://www.vbaexpress.com/forum/clear.gif] Edit Post   [Blocked Image: http://www.vbaexpress.com/forum/clear.gif] Reply   [Blocked Image: http://www.vbaexpress.com/forum/clear.gif] Reply With Quote   [Blocked Image: http://www.vbaexpress.com/forum/images/buttons/multiquote_40b.png]     
  • Please pay attention to our Forum Rules about cross posting in future. You will find most Excel Forums have the same rule.


    This will work if you only have one ListBox or don't mid deleting all.


    Code
    1. Dim shp As Shape
    2. For Each shp In ActiveSheet.Shapes
    3. If Left(shp.Name, 4) = "List" Then shp.Delete
    4. Next shp

    You should rename the ListBox in your code so that you can delete the specific ListBox if you have more than one.