Hi all
Textbox 1 and 2 are formatted as currency.
How can these textboxes be summed in the Total textbox? I tried using
This is the remaining code:
Would appreciate your thoughts?
Russel
Textbox 1 and 2 are formatted as currency.
How can these textboxes be summed in the Total textbox? I tried using
Code:
Total.Value = Format(Textbox1.Value + Textbox2.Value, "Currency")
This is the remaining code:
Code:
Private Sub Textbox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Textbox1 = "" Then
Exit Sub
End If
If IsNumeric(Textbox1) Then
Textbox1 = Format(Textbox1.Value, "Currency")
Total.Value = Format(Textbox1.Value + Textbox2.Value, "Currency")
Else
MsgBox "Please enter a numerical value"
Cancel = True
End If
End Sub
Private Sub Textbox2_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Textbox2 = "" Then
Exit Sub
End If
If IsNumeric(Textbox2) Then
Textbox2 = Format(Textbox2.Value, "Currency")
Total.Value = Format(Textbox1.Value + Textbox2.Value, "Currency")
Else
MsgBox "Please enter a numerical value"
End If
End Sub
Would appreciate your thoughts?
Russel