Update fields in a UserForm if a change is made

tigerdel

Board Regular
Joined
Oct 13, 2015
Messages
145
Office Version
  1. 365
Platform
  1. Windows
I have a UserForm with the following fields:

1. cmbCategory = ""
2. cmbDescription = ""
3. txtProductID = ""
4. txtQty = ""
5. cmbMarkUp = ""
6. txtUOM = ""
7. txtPrice = ""
8. txtMarkUp = ""
9. txtTotal = ""

If I make a change to 1 or 2 the txtPrice changes but txtTotal & txtMarkUp doesn't
If I make a change to 4 or 5 txtTotal & txtMarkUp doesn't change

Is there a way to forced the txtboxes update if changes are made?

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Create a common code that performs the calculation & then call if from the appropriate textboxes

e.g

Common code

VBA Code:
Sub CalcTotal()
    txtMarkUp.Value = Val(txtPrice.Value) * (1 + Val(cmbMarkUp.Value) / 100)
    txtTotal.Value = Val(txtPrice.Value) * Val(txtQty)
End Sub

and call from textboxes

VBA Code:
Private Sub cmbMarkUp_Change()
    Call CalcTotal
End Sub


Private Sub txtQty_Change()
    Call CalcTotal
End Sub

This is just an example and a large guess - you will need to adjust to meet specific project need

Dave
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

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