Hello,
I have a user form with 3 text boxes and 2 command buttons. My problem is getting text box 3 to perform a calculation based on cost price in text box 1 and the percentage I need to reduce it by to show the discounted buying price. So for example, if a product costs £100, take 20% off, then £80 should show in text box 3. Just cant figure out the code to get it to do this.
My user form loads, my command buttons to clear the text boxes 1&2 works, my command button to close the user form works. I have been trying to perform the calculation as follows:
Private Sub CalcDec()
TextBox3.value = ((TextBox1.value) - (1-(Textbox2.Value)))
End Sub
Additionally, I have the formula stared in Sheet1 of my workbook in cell B5. My formula is =B3-(1-(B4))
I have tried to use If and When Statements, all with no Luck. Can anyone point me in the right direction.
I have a user form with 3 text boxes and 2 command buttons. My problem is getting text box 3 to perform a calculation based on cost price in text box 1 and the percentage I need to reduce it by to show the discounted buying price. So for example, if a product costs £100, take 20% off, then £80 should show in text box 3. Just cant figure out the code to get it to do this.
My user form loads, my command buttons to clear the text boxes 1&2 works, my command button to close the user form works. I have been trying to perform the calculation as follows:
Private Sub CalcDec()
TextBox3.value = ((TextBox1.value) - (1-(Textbox2.Value)))
End Sub
Additionally, I have the formula stared in Sheet1 of my workbook in cell B5. My formula is =B3-(1-(B4))
I have tried to use If and When Statements, all with no Luck. Can anyone point me in the right direction.