Can I put a Formula into an Excel User Form?

J

jamie

I have a userform with three text boxes...

TxtBox1
TxtBox2
TxtBox3

Each text box fills a cell (on clicking CmdOK) A1, A2, A3

I want TxtBox1 to muliplty by TxtBox2 and the value to enter
TxtBox3...

Can this be done. I know that I can put this simple formula into the
worksheet but I want the use to work in the userform...So the formula/
calculation has to be done in VB?

Regards and thanks in advance!

Jamie
 
S

Shasur

Hi

Can you try the following in the change events of

TxtBox1 and TxtBox2

Private Sub TxtBox1_Change()
On Error Resume neXt
TxtBox3.Text = TxtBox1.Text * TxtBox2.Text
End Sub

Private Sub TxtBox2_Change()
On Error Resume neXt
TxtBox3.Text = TxtBox1.Text * TxtBox2.Text
End Sub

Cheers
Shasur
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top