Hi,
I am new to vba. I have created a work request form where the user selects a block, type of work required, and inserts their name and details, when they press submit that information is then written to a worksheet (Work Status). which works fine.
What i want to happen is the for user to be able to select multiple blocks with the same type of work details etc and written to separate lines on the worksheet.
lets say user selects blocks 1, 2, 3, 4, 6, 50 and they want those block mowed. when submit is pressed each block should be on a separate line of the work sheet all with the same info.
Help would be greatly appreciated
Private Sub CommandButton1_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("Work Status")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 1) = CDate(Me.tbdate)
ssheet.Cells(nr, 2) = Me.lbblock
ssheet.Cells(nr, 3) = Me.cbinquiry
ssheet.Cells(nr, 4) = Me.tbdetails
ssheet.Cells(nr, 5) = Me.tbname
lbblock.Text = ""
tbdetails.Text = ""
tbname.Text = ""
cbinquiry.Text = ""
ThisWorkbook.Save
End Sub
I am new to vba. I have created a work request form where the user selects a block, type of work required, and inserts their name and details, when they press submit that information is then written to a worksheet (Work Status). which works fine.
What i want to happen is the for user to be able to select multiple blocks with the same type of work details etc and written to separate lines on the worksheet.
lets say user selects blocks 1, 2, 3, 4, 6, 50 and they want those block mowed. when submit is pressed each block should be on a separate line of the work sheet all with the same info.
Help would be greatly appreciated
Private Sub CommandButton1_Click()
Dim ssheet As Worksheet
Set ssheet = ThisWorkbook.Sheets("Work Status")
nr = ssheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
ssheet.Cells(nr, 1) = CDate(Me.tbdate)
ssheet.Cells(nr, 2) = Me.lbblock
ssheet.Cells(nr, 3) = Me.cbinquiry
ssheet.Cells(nr, 4) = Me.tbdetails
ssheet.Cells(nr, 5) = Me.tbname
lbblock.Text = ""
tbdetails.Text = ""
tbname.Text = ""
cbinquiry.Text = ""
ThisWorkbook.Save
End Sub