Harley78
Electrical
- May 8, 2007
- 77
I have a question and I am stumped.
I have a userform1 that is filled then when a label28 is pressed a userform pops up with a listbox (multi selection). and a label underneath for the merging of the selections. Now I am stuck trying to make this work and also how would I make it that the label on Userform1 = userform2 label.
Here is my code thus far, just can't seem to get it to work.
Private Sub Userform_Initialize()
With ListBox1
.MultiSelect = fmMultiSelectMulti
ListBox1.List = Sheet4.Range("AL2:AL166").Value
End With
End Sub
Private Sub OK_Click()
Dim I As Long
Dim strCont As String
For I = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(I) Then
strCont = strCont & ListBox1.List(I) & "//"
ListBox1.Selected(I) = False
End If
Next I
Label1.Caption = Left(strCont, Len(strCont) - 1)
Me.Range("CP" & Sel_Row).Value ' THIS SEEMS TO BE THE PROBLEM
Unload UserForm2
End Sub
If anyone can help me or give me a suggestion, I would greatly appreciate it.
Regards
Bill
I have a userform1 that is filled then when a label28 is pressed a userform pops up with a listbox (multi selection). and a label underneath for the merging of the selections. Now I am stuck trying to make this work and also how would I make it that the label on Userform1 = userform2 label.
Here is my code thus far, just can't seem to get it to work.
Private Sub Userform_Initialize()
With ListBox1
.MultiSelect = fmMultiSelectMulti
ListBox1.List = Sheet4.Range("AL2:AL166").Value
End With
End Sub
Private Sub OK_Click()
Dim I As Long
Dim strCont As String
For I = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(I) Then
strCont = strCont & ListBox1.List(I) & "//"
ListBox1.Selected(I) = False
End If
Next I
Label1.Caption = Left(strCont, Len(strCont) - 1)
Me.Range("CP" & Sel_Row).Value ' THIS SEEMS TO BE THE PROBLEM
Unload UserForm2
End Sub
If anyone can help me or give me a suggestion, I would greatly appreciate it.
Regards
Bill