stirlingmw
Board Regular
- Joined
- Feb 18, 2013
- Messages
- 75
Is there as way of sending the contents of a Multi Column Listbox to a single cell in a worksheet.
I am currently using the following code to send data from a Userform to Worksheet, but for some reason the data from my Multi Column listbox does not transfer over. The data is a combination of Job Role and Name of the person doing that role. The data must not over right any existing data in that cell.
I also need for the data to be displayed in Multi Column format in lstTeam if already present when selected using CmbFindProject combobox.
Thanks in advance
Steve
I am currently using the following code to send data from a Userform to Worksheet, but for some reason the data from my Multi Column listbox does not transfer over. The data is a combination of Job Role and Name of the person doing that role. The data must not over right any existing data in that cell.
Code:
Private Sub pSave()
Dim a As Long
If blnNew = True Then
totRows = Worksheets("Project Master").Range("A1").CurrentRegion.Rows.count
With Worksheets("Project Master").Range("A1")
.Offset(totRows, 0) = lstTeam.text
End With
Call comboboxFill 'This fi
Else
totRows = Worksheets("Project Master").Range("A1").CurrentRegion.Rows.count
For i = 2 To totRows
If Trim(Worksheets("Project Master").Cells(i, 3)) = Trim(CmbFindProject.text) Then 'Finds project to update, or allows new data to be added to a new line
Worksheets("Project Master").Cells(i, 1) = lstTeam.text 'Multi Column listbox, 2 columns of data, lots of rows
Exit For
End If
Next i
End If
End Sub
Code:
Private Sub comboboxFill()
CmbFindProject.Clear
totRows = Worksheets("Project Master").Range("A1").CurrentRegion.Rows.count
For i = 2 To totRows
CmbFindProject.AddItem Worksheets("Project Master").Cells(i, 4).Value
Next i
End Sub
I also need for the data to be displayed in Multi Column format in lstTeam if already present when selected using CmbFindProject combobox.
Thanks in advance
Steve