+ Reply to Thread
Results 1 to 3 of 3

problem vba code for multiselect listbox (userform)

  1. #1
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    191

    problem vba code for multiselect listbox (userform)

    in the attached file, I drafted a userform "PANDL" (which is actually the copy of the page 2 of the userform "cargo2016").

    In this userform I would have like to be able to select several ref and to populate the userform with infos for each of them..

    But my knowledge in VBA is null and I don't know how to say for each selected item in the listbox "REF", get datas.....

    I tried to put a "ok" command to validate the selection in REF listbox with following code...

    Please Login or Register  to view this content.
    but obviously the ref.value remain "null".....

    can someone give me some tips to search further?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: problem vba code for multiselect listbox (userform)

    Quote Originally Posted by mariec_06 View Post
    In this userform I would have like to be able to select several ref and to populate the userform with infos for each of them..
    The PANDL form can only display the info for one REF at a time. Why have a multi-select list?


    I don't know how to say for each selected item in the listbox "REF", get datas.....

    but obviously the ref.value remain "null".....

    can someone give me some tips to search further?

    Use the index number i to get the selected RefNumber from the list and pass it to the GetData procedure.

    Please Login or Register  to view this content.

    Then use the passed RefNumber to search

    Please Login or Register  to view this content.
    There are many other problems with the GetData code, but this is how to pass each selected RefNumber in the Ref.List to GetData.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    191

    Re: problem vba code for multiselect listbox (userform)

    The userform "cargo2016" works perfectly for one ref, but I would like for example to print all the pandl forms of all the ref of January for ex or for all the ref from 2016CT003 to 2016CT006 that's why I was thinking multiselect will be appropriate

+ 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. UserForm: Enable Textbox When "Other" Selected in MultiSelect Listbox (Excel 2010)
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-02-2014, 06:40 PM
  2. Listbox multiselect- VBA code error
    By sassy1978 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2013, 07:22 PM
  3. [SOLVED] MultiSelect Listbox in Userform to copy data to worksheet
    By aarodn in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-06-2013, 03:52 PM
  4. Copy Selected items from multicolumn, multiselect listbox to another listbox
    By Willigb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 11:27 AM
  5. [SOLVED] listindex=0 when first item selected in a multiselect listbox on a userform?
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-17-2013, 12:38 PM
  6. Unable to Detect When UserForm MultiSelect ListBox Selection Changes
    By ShortSword in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2012, 10:49 PM
  7. How to adapt this listbox code when multiselect is enabled?
    By Kimberley in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-02-2011, 02:00 PM
  8. userform multiselect listbox problem
    By apndas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-24-2006, 11:12 PM

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