kevinc1973
New Member
- Joined
- Jun 20, 2019
- Messages
- 22
Hello all,
I was wondering if any one can help with this:
Everything works like it should when there is a value on the spreadsheet in "AW" cell, if there is no value in the cell then it wont add the data and goes to debug. If I get rid of + textbox3.value it works but then it wont add the gallons together. Thanks for any help
I was wondering if any one can help with this:
Code:
Private Sub Userform_Activate()
TextBox3.Value = Sheets("Template").Range("AW" & Day(TextBox1.Value) + 7).Value
End Sub
Private Sub CMDADD_Click()
Sheets("Template").Range("AW" & Day(TextBox1.Value) + 7) = TextBox2.Value / (TextBox4.Value * 8.34) + TextBox3.Value
Unload Me
ThisWorkbook.Sheets("MAIN PAGE").Activate
ThisWorkbook.Save
End Sub
Private Sub CMDCLOSE_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize()
TextBox1.Value = Date
End Sub
Everything works like it should when there is a value on the spreadsheet in "AW" cell, if there is no value in the cell then it wont add the data and goes to debug. If I get rid of + textbox3.value it works but then it wont add the gallons together. Thanks for any help