Ferreira1456
New Member
- Joined
- Mar 20, 2018
- Messages
- 30
- Office Version
- 365
- Platform
- Windows
I've got an excel UserForm Multi Page with four TextBox on the MultiPage3. I have tried many ways (Exit, AfterUpdate, Change, BeforeUpdate).
I want to sum all value of this textBox at MultiPage4 txtShopSuppliesTotal.
How can I delete the value of the textBox on the MultiPage3, simultaneously delete the value of txtShopSuppliesTotal on MultiPage4 ? Thank you.
I want to sum all value of this textBox at MultiPage4 txtShopSuppliesTotal.
How can I delete the value of the textBox on the MultiPage3, simultaneously delete the value of txtShopSuppliesTotal on MultiPage4 ? Thank you.
VBA Code:
Private Sub txtSupplies1Price_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim s1, s2, s3, s4 As Double
'Error check: does txtSupplies1Price have a number and is not null
If IsNumeric(txtSupplies1Price.Value) And txtSupplies1Price.Value <> vbNullString Then
s1 = txtSupplies1Price.Value * 1
Else
With txtSupplies1Price
End If
txtSupplies1Price.Value = Format(txtSupplies1Price.Value, "CURRENCY")
If IsNumeric(txtSupplies2Price.Value) And txtSupplies2Price.Value <> vbNullString Then
s2 = txtSupplies2Price.Value
Else
txtShopSuppliesTotal.Value = ""
txtSupplies2Price.Value = Format(txtSupplies2Price.Value, "CURRENCY")
End If
If IsNumeric(txtSupplies3Price.Value) And txtSupplies3Price.Value <> vbNullString Then
s3 = txtSupplies3Price.Value
Else
txtShopSuppliesTotal.Value = ""
txtSupplies3Price.Value = Format(txtSupplies3Price.Value, "CURRENCY")
End If
If IsNumeric(txtSupplies4Price.Value) And txtSupplies4Price.Value <> vbNullString Then
s4 = txtSupplies4Price.Value
Else
txtShopSuppliesTotal.Value = ""
txtSupplies4Price.Value = Format(txtSupplies4Price.Value, "CURRENCY")
End If
txtShopSuppliesTotal = s1 + s2 + s3 + s4
End Sub
Last edited by a moderator: