+ Reply to Thread
Results 1 to 3 of 3

Capture a cell out of range of Listbox Selection and Fill in Other Listbox

  1. #1
    Registered User
    Join Date
    05-06-2012
    Location
    Lisbon,Portugal
    MS-Off Ver
    Excel 2010
    Posts
    79

    Capture a cell out of range of Listbox Selection and Fill in Other Listbox

    Hi everyone
    I have a listbox on my userform where I select a row.
    The data comes from sheet1
    This sheet have several columns(10) and that listbox show only the first 4 columns, and this is what I want.
    I would like to show on other listbox or in a label, at same userform, the line corresponding to the selected in the listbox, but of the 10th column.
    Will be possible?
    I tried with the code bellow, but wihtout any result, because It shows all data from that column(k).
    Thank you very much
    Dim LastRow, x, CurVal As Range
    '''find the lastrow 'Data begin column B and goes until k
    LastRow = Sheet1.cells(Rows.Count, 2).End(xlUp).Row
    '''clear listbox4
    Me.ListBox4.Clear
    CurVal = Me.ListBox1.Value '''''ListBox1.List(ListBox1.ListIndex, i) 'Me.ListBox1.Value
    ''
    For x = 2 To LastRow
    If Sheet1.cells(x, "b") = CurVal Then
    'found a match populate listbox4
    Me.ListBox4.AddItem Sheet1.cells(x, "k")
    End If
    Next x

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Capture a cell out of range of Listbox Selection and Fill in Other Listbox

    see big yellow banner - upload your workbook - not all of us will want to build the app from scratch.
    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    05-06-2012
    Location
    Lisbon,Portugal
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Capture a cell out of range of Listbox Selection and Fill in Other Listbox

    Hi Torachan

    To give an example for a similar, simpler situation, it would be quite complicated for me to do.
    However, through several attempts and ways to solve it, I managed to solve my problem.
    However, I appreciate all the openness and availability to solve my problem.
    My thanks

+ 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. Populate (ca 200) Txtboxes depending on listbox selection, live-filter for listbox &1 more
    By InternInNeed in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2016, 09:56 AM
  2. Creating a Range of a Listbox based on the Selection Made in Another ListBox
    By masood78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2014, 11:03 AM
  3. Trying to copy a cell range to a different worksheet based on the selection from a ListBox
    By WarrenSmiley in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-10-2013, 03:02 PM
  4. [SOLVED] Indexing proper range in listbox depending on selection in previous listbox
    By bloodmeat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2013, 02:31 PM
  5. Replies: 12
    Last Post: 08-28-2012, 07:09 AM
  6. Multi select Listbox Items selection based on other Listbox item selection.
    By srinivassathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 05:53 AM
  7. capture second column of named range from ListBox.ListIndex
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2010, 03:42 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