+ Reply to Thread
Results 1 to 7 of 7

Macro to run when item is selected from listbox

Hybrid View

kosherboy Macro to run when item is... 04-30-2014, 01:16 PM
HaHoBe Re: Macro to run when item is... 04-30-2014, 01:20 PM
kosherboy Re: Macro to run when item is... 04-30-2014, 01:24 PM
HaHoBe Re: Macro to run when item is... 04-30-2014, 01:31 PM
kosherboy Re: Macro to run when item is... 04-30-2014, 01:37 PM
kosherboy Re: Macro to run when item is... 04-30-2014, 09:58 PM
kosherboy Re: Macro to run when item is... 04-30-2014, 04:43 PM
  1. #1
    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
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  2. #2
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Macro to run when item is selected from listbox

    Holger, it worked, thank you!

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Macro to run when item is selected from listbox

    Hey Holger, i spent some time and figured out the problem
    See you around

+ Reply to Thread

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