Hi All,
Just need a little help if possible please. I have a form with a number of fields that once submitted paste the data in the next blank row in a sheet (as below). A user will input the date of the week commencing in a text box on the form (Calendar1) and a number of days in another box (txtSupp). I need it to submit the value of "txtSupp" in the same row on the sheet under the right date of the week commencing based on date in "Calendar1". Rows L1 to EJ1 of the sheet have the date of the week commencing starting from 02/04/2012. E.g. L1 = 02/04/2012, M1 = 09/04/2012 etc.
Any help is really appreciated. Thanks in advanced!
Private Sub SubmitForm_Click()
ActiveWorkbook.Sheets("Data").Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
Application.ScreenUpdating = False
ActiveCell.Value = ListBox1.Value
ActiveCell.Offset(0, 1) = txtDate.Value
ActiveCell.Offset(0, 2) = ListBox2.Value
ActiveCell.Offset(0, 3) = txtDir.Value
ActiveCell.Offset(0, 4) = txtReqNo.Value
ActiveCell.Offset(0, 6) = ComboBox1.Value
ActiveCell.Offset(0, 7) = ComboBox2.Value
ActiveCell.Offset(0, 8) = ComboBox3.Value
ActiveCell.Offset(0, 9) = txtSign.Value
ActiveCell.Offset(0, 10) = txtSupp.Value
End Sub
Just need a little help if possible please. I have a form with a number of fields that once submitted paste the data in the next blank row in a sheet (as below). A user will input the date of the week commencing in a text box on the form (Calendar1) and a number of days in another box (txtSupp). I need it to submit the value of "txtSupp" in the same row on the sheet under the right date of the week commencing based on date in "Calendar1". Rows L1 to EJ1 of the sheet have the date of the week commencing starting from 02/04/2012. E.g. L1 = 02/04/2012, M1 = 09/04/2012 etc.
Any help is really appreciated. Thanks in advanced!
Private Sub SubmitForm_Click()
ActiveWorkbook.Sheets("Data").Activate
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
Application.ScreenUpdating = False
ActiveCell.Value = ListBox1.Value
ActiveCell.Offset(0, 1) = txtDate.Value
ActiveCell.Offset(0, 2) = ListBox2.Value
ActiveCell.Offset(0, 3) = txtDir.Value
ActiveCell.Offset(0, 4) = txtReqNo.Value
ActiveCell.Offset(0, 6) = ComboBox1.Value
ActiveCell.Offset(0, 7) = ComboBox2.Value
ActiveCell.Offset(0, 8) = ComboBox3.Value
ActiveCell.Offset(0, 9) = txtSign.Value
ActiveCell.Offset(0, 10) = txtSupp.Value
End Sub