I'm not sure if my title explains what I am trying to ask,
I am attempting to write code to copy data from nonadjacent cells of one worksheet to a worksheet in a different workbook. I have written the code to copy and paste all of the data except one section of data that comes from a userform listbox. Two codes for the listbox are
Private Sub cbNames_Click()
Dim nItem As Long
For nItem = 0 To lbNames.ListCount - 1
lbNames.Selected(nItem) = cbNames
Next
End Sub
Private Sub cmdUseNames_Click()
Dim msg As String, i As Integer
msg = ""
With ufPersonnel.lbNames
For i = 0 To .ListCount - 1
If .Selected(i) Then
msg = msg & .List(i) & Chr(59) & Chr(32)
End If
Next i
End With
Sheet1.Range("P_O_S_View").Value = msg
Call AllProtect
Unload Me
End Sub
The worksheet that is receiving the data is on the idea of a logbook. I have a column for each member and in each row I put a "1" in the cell if they were present and the cell is left blank if they were not. At the bottom of each column is a formula that calculates the percentage of calls present compared to the toltal number of calls.
In the worksheet that will be sending the data, the names that are checked in the listbox are dumped into a merged range of cells with semicolons between them. I need to be able to paste a "1" for each name that is selected.
If someone has an idea of how to do this, I would really apreciate the help.
Bookmarks