Delete the value of the textBox on the MultiPage3, simultaneously delete the value of textBox on the MultiPage4.

Ferreira1456

New Member
Joined
Mar 20, 2018
Messages
30
Office Version
  1. 365
Platform
  1. 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.

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:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Your script seems to be doing a lot.
Here is how you would add values to Multipage Pages Textboxes
Just modify something like this:
VBA Code:
Private Sub CommandButton1_Click()
'Modified  12/27/2020  4:02:36 AM  EST
With MultiPage1
    .Page1.TextBox1.Value = "Alpha"
    .Page2.TextBox2.Value = "Bravo"
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top