KRKComputers
New Member
- Joined
- Nov 10, 2017
- Messages
- 43
I am wondering if someone can give me some input as to why this may not be working! I have the following code that I am using and it has been attached to a sheet called Main Table and for some reason I am not getting any errors with the code however when I try to input anything into the input boxes I do not get any entry on my spreadsheet which I find odd.
The spreadsheet does have 280 entries already in place and I did try the code on an empty sheet as well and get the same response it does not work and will not populate the fields as it should be doing.
When I hi the ENTER button the fields do not clear and start the process all over again. If anyone can give me some insight it would be greatly appreciated.
The spreadsheet does have 280 entries already in place and I did try the code on an empty sheet as well and get the same response it does not work and will not populate the fields as it should be doing.
When I hi the ENTER button the fields do not clear and start the process all over again. If anyone can give me some insight it would be greatly appreciated.
Code:
Private Sub CommandButton()If TextBox1.Value = "" Or TextBox2.Value = "" Or TextBox3.Value = "" Or TextBox4.Value = "" Or TextBox5.Value = "" Or TextBox6.Value = "" Or TextBox7.Value = "" Or TextBox8.Value = "" Or TextBox9.Value = "" Or TextBox10.Value = "" Or TextBox11.Value = "" Or TextBox12.Value = "" Or TextBox13.Value = "" Or TextBox14.Value = "" Or TextBox15.Value = "" Then
If MsgBox("Form is not complete. Do you want to continue?", vbQuestion + vbYesNo) <> vbYes Then
Exit Sub
End If
End If
ActiveCell = TextBox1.Value
ActiveCell.Offset(0, 1) = TextBox2.Value
ActiveCell.Offset(0, 2) = TextBox3.Value
ActiveCell.Offset(0, 3) = TextBox4.Value
ActiveCell.Offset(0, 4) = TextBox5.Value
ActiveCell.Offset(0, 5) = TextBox6.Value
ActiveCell.Offset(0, 6) = TextBox7.Value
ActiveCell.Offset(0, 7) = TextBox8.Value
ActiveCell.Offset(0, 8) = TextBox9.Value
ActiveCell.Offset(0, 9) = TextBox10.Value
ActiveCell.Offset(0, 10) = TextBox11.Value
ActiveCell.Offset(0, 11) = TextBox12.Value
ActiveCell.Offset(0, 12) = TextBox13.Value
ActiveCell.Offset(0, 13) = TextBox14.Value
ActiveCell.Offset(0, 14) = TextBox15.Value
ActiveCell.Offset(1, 0).Select
Cell ResetForm
End Sub
Sub ResetForm()
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
TextBox11.Value = ""
TextBox12.Value = ""
TextBox13.Value = ""
TextBox14.Value = ""
TextBox15.Value = ""
UserForm1.TextBox1.SetFocus
End Sub