Sabtu, 14 Februari 2015

[ExcelVBA] How do you get code assigned to a ListBox to run even when the same item is selected?



I have a ListBox on Worksheet "PlayList".   When the macro below is assigned to the ListBox, it does what I want, as long as I choose an item on the list different from the previous selection:


Sub Game2_Click()


      Range("ChangedGame2").Value = "Yes"

      UnProtectSheet ("PlayList")

        Range("CustomName1").Offset(0, 1).Value = ""

      ProtectSheet ("PlayList")

End Sub


But when I select the same (as previous) item from the drop-down list, nothing happens.  I have tried replacing "Click" with "AfterUpdate", "KeyPress", "BeforeUpdate", "Selection", and "Select"  (basically, everything I could find on Google, with the exception of "Kardashian").    With each of those events, the code runs only if I've picked a new item from the List.

How can I get that code to run every time I click on the ListBox?


Posted by:
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: to enter the ezine, then search the ARCHIVES for EXCEL VBA.

Visit our ExcelVBA group home page for more info and support files:

More free tutorials and resources available at:




Tidak ada komentar:

Posting Komentar