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
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.Quote:
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.
Ok. How about 2 ListBoxes?