Using a userform and need to user separate sheets in the workbook to accomplish the task. Code first:
Dim ws As Worksheet
Dim ws2 As Worksheet
Dim ws3 As Worksheet
Dim emptyRow As Long
Set ws = Worksheets("Populated Shifts")
Set ws2 = Worksheets("Event")
Set ws3 = Worksheets("Volunteers")
emptyRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row + 1
ws.Cells(emptyRow, 1).Value = Me.cmbVol1.Value
ws.Cells(emptyRow, 2).Value = Me.cmbEventName.Value
ws.Cells(emptyRow, 3).Value = Me.cmbStartTime.Value
ws.Cells(emptyRow, 4).Value = Me.cmbEndTime.Value
ws.Cells(emptyRow, 5).Value = ws2.Cells(Me.cmbEventName.RowSource, 1).Value
ws.Cells(emptyRow, 7).Value = ws3.Cells(Me.cmbVol1.RowSource, 2).Value
With ws
If Me.cmbVol2.Value > "" Then
emptyRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(emptyRow, 1).Value = Me.cmbVol2.Value
.Cells(emptyRow, 2).Value = Me.cmbEventName.Value
.Cells(emptyRow, 3).Value = Me.cmbStartTime.Value
.Cells(emptyRow, 4).Value = Me.cmbEndTime.Value
.Cells(emptyRow, 5).Value = ws2.Cells(Me.cmbEventName.RowSource, 1).Value
.Cells(emptyRow, 7).Value = ws3.Cells(Me.cmbVol2.RowSource, 2).Value
End If
The problem comes with adding to columns 5 and 7. I'm not sure I know how to properly use RowSource.
Basically I need to get the row of the information from the selected choice in a combo box and then input into columns 5 and 7 different info from those rows. All on a different sheet.
If you need more info let me know.
Thanks.
Bookmarks