Results 1 to 7 of 7

Macro to run when item is selected from listbox

Threaded View

  1. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro to run when item is selected from listbox

    Hi, kosherboy,

    I just had the ListFillRange on the sheet, added a listbox from the ActiveX controls, limited it to single select, assigned the ListFilRange, ended the "developer mode", put the code behind the sheet:
    Private Sub ListBox1_Change()
    myMacro ListBox1.ListIndex + 1
    End Sub
    
    Sub myMacro(lngNumber As Long)
    MsgBox "Called from Listbox entry: " & lngNumber
    End Sub
    Ciao,
    Holger
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Listbox selected item not getting properly highlighted
    By KeithDyne in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2021, 10:31 PM
  2. Remove selected item from listbox
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-28-2014, 08:36 AM
  3. how do I return a HIGHLIGHTED (not selected) item from a ListBox?
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 08:27 AM
  4. Change status of more than one item selected in Listbox
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-29-2012, 05:09 AM
  5. Need selected item from listbox after double click
    By peterfarge@hotmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2006, 11:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1