I am trying to populate a text box in a user form with the result of the subtraction of the values of 2 other text boxes.
Similar code works when the format of the textboxes are currency
NOTE: the Textboxes have a maximum of 6 characters and the values are to one decimal place
Thank you in advance
Similar code works when the format of the textboxes are currency
VBA Code:
Private Sub EndReadingDay_AfterUpdate()
Dim c As Double, d As Double
c = txtStartReadingDay.Value
d = txtEndReadingDay.Value
txtUnitsUsedDay.Value = Format(Val(d - c, "#,##0.0"))
End Sub
NOTE: the Textboxes have a maximum of 6 characters and the values are to one decimal place
Thank you in advance