Hi All
Am trying to add data to an existing data in a cell separate by comma from a single select Listbox1 Userform yet the row is selected from another Listbox2 example for editing i have a add command button that suppose to add a select data to an existing data in a cell but when i do this it goes to other column. that is the code am trying
Am trying to add data to an existing data in a cell separate by comma from a single select Listbox1 Userform yet the row is selected from another Listbox2 example for editing i have a add command button that suppose to add a select data to an existing data in a cell but when i do this it goes to other column. that is the code am trying
Rich (BB code):
ActiveCell.Offset(0, 5).Select
With Worksheets("Sheet1")
Set ws = Worksheets("Sheet1")
lRow = ws.Cells(Rows.Count, 8).End(xlUp)
'.Offset(1, 0).Row
' With ws
' .Cells(lRow, 5).Value = Me.ListBox2.Value
For y = 1 To ListBox2.ListCount + 1
If ListBox2.Selected(y) = True Then strListBox = strListBox & ListBox2.List(y) & " ; "
Next y
If Len(strListBox) <> 1 Then
strListBox = Mid(strListBox, 1, Len(strListBox) + 1)
.Cells(lRow, 5).Value = strListBox
Else
If Len(strListBox) = 1 Then
.Cells(lRow, 5).Value = " "
End If
End If