Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: $20 Multiselect Listbox With OptionButtons To Be Filled From Named Range

  1. #11
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Thanks snb for being 100%

    Nozitall, do you want an additional list box for that, or want to use the same list box and get all values from both named ranges to the same listbox?

  2. #12
    Junior Member
    Join Date
    Feb 2012
    Posts
    6
    Rep Power
    0
    Fox
    I'm trying to set the listbox up for data entry so yes, I want to use the same listbox.
    Sorry for doing this piecemeal but I thought I could replicate the code you provided for addition fields.
    Ed

  3. #13
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Here's the revised file

    Code:
    Private Sub UserForm_Activate()
    
        Dim var As Variant
        Dim varArray As Variant
        Const cstrRanges As String = "StartTimes,EndTimes"
        With Worksheets("Sheet1")
            For Each var In Split(cstrRanges, ",")
                If IsArray(varArray) Then
                    varArray = Split(Join(varArray, "|") & "|" & Join(Application.Transpose(.Range(CStr(var)).Value2), "|"), "|")
                Else
                    varArray = Application.Transpose(.Range(CStr(var)).Value2)
                End If
            Next var
        End With
        Me.lstStartTimes.List = varArray
        
    End Sub
    Attached Files Attached Files
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  4. #14
    Junior Member
    Join Date
    Feb 2012
    Posts
    6
    Rep Power
    0
    Fox:
    I think we're getting there.
    Sorry I didn't make myself clearer.

    On the Form, the StartTimes and End Times should be in separate columns (with Titles) and
    the selected items from the list StartTimes should appear in I1 and the selected items for the list EndTimes should appear in J1.

    You can forget about the ListBox as I've decided to go with the Form
    Ed

  5. #15
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Quote Originally Posted by NOZITALL
    yes, I want to use the same listbox
    You are contradicting what you mentioned earlier. Could you please clarify.

    Not only that, you cannot have separate selections for each column in a ListBox. Every item in each row is selected, across all columns, not one by one.
    Last edited by Excel Fox; 01-07-2014 at 12:15 AM. Reason: Addendum
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  6. #16
    Junior Member
    Join Date
    Feb 2012
    Posts
    6
    Rep Power
    0
    Ok. How about 2 ListBoxes?

Similar Threads

  1. Replies: 12
    Last Post: 07-26-2013, 07:39 AM
  2. Replies: 4
    Last Post: 07-02-2013, 11:32 AM
  3. Replies: 2
    Last Post: 06-24-2013, 07:40 PM
  4. Replies: 19
    Last Post: 02-11-2013, 10:49 PM
  5. Get last Filled Cell address in a Range.
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 3
    Last Post: 03-24-2012, 01:08 AM

Tags for this Thread

Posting Permissions

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