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?
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?
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
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
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
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
You are contradicting what you mentioned earlier. Could you please clarify.Originally Posted by NOZITALL
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
Ok. How about 2 ListBoxes?
Bookmarks