+ Reply to Thread
Results 1 to 10 of 10

Multiple selections in listbox

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Multiple selections in listbox

    Hi again,

    I have a Listbox with drawing numbers, and I need to be able to select multiple drawings from that listbox by any means (maybe tickbox?) and then save ID of the selected drawings on a line in another sheet. Is that possible?

    Best regards,

    Jakes
    Last edited by Jakes; 01-20-2012 at 05:20 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multiple selections in listbox

    Where is the ListBox?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Multiple selections in listbox

    i apologize for the lack of info

    I have a Form1 with a Listbox1 that have a rowsource value referring to sheet1( the drawing ID, Number and name). I need to be able to select multiple drawing numbers from Listbox1, and save only the drawing ID of the selected on Sheet 2, in the next open row starting on column B

    If needed, I will attach my spreadsheet for more info?

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Multiple selections in listbox

    This is untested but the code would be roughly
    dim n as long
    with me.listbox1
    for n = 1 to .listcount
    if .selected(n - 1) then sheets("Sheet 2").Cells(rows.count, "B").end(xlup).offset(1).Value = .list(n - 1, 0)
    next n
    End With
    Good luck.

  5. #5
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Multiple selections in listbox

    Thank you, appreciate the help. But I came across another problem, I need to state the quantity of the drawings selected, for example, I have selected three copies of Drawing 1, and one copy of drawing 2, so in addition to select the drawings, I need a value entered manually as well. any idea what I can do?

    The end result I need is that the selected info need to be written to sheet 2 in one row, for example:
    A | B | C | D | E | F | G | etc
    Issue slip ID| Drawing 1 ID | Drawing 1 QTY | Drawing 2 ID | Drawing 2 QTY | Drawing 3 ID | Drawing 3 QTY |

    Thanks for the help!

  6. #6
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Multiple selections in listbox

    At this stage I think a sample workbook would be useful.

  7. #7
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Multiple selections in listbox

    Hi there,

    attached is the template. This is for a basic Drawing issue slip manager, the basic operation is that all the drawings on a project will be entered into Sheet 1 (Drawings) and when issuing drawings to a contractor, you select the drawing ID's from the listbox, add the quantity of drawings issued, and write the info to Sheet 2 (Issues) and I will still create a sheet containing a template for printing the issues

    issue template.xlsm

    Thank you so long

  8. #8
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Multiple selections in listbox

    You could try something like this?
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Multiple selections in listbox

    AWESOME! Thank you very much I REALLy appreciate the help!

  10. #10
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Multiple selections in listbox

    My pleasure.

    Please do not forget to mark this question Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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