How to calculate data that is entered into a text box

M

Maddoktor

Hi all,

I have designed a user form for one of my workbooks that collects data from
the user.

I have three textboxes that collect numeric values.

When a user enters data into TextBox1 only or in both TextBox1 and TextBox2,
and a value is entered into TextBox3, I would like for TextBox4 (or Label1)
to calculate by the figure entered into TextBox3 by the number of textboxes
(either only TextBox1 or both TextBox1 and TextBox2) that have data entered.

For example:

TextBox1 = 100000
TextBox2 = left blank
TextBox3 = 50
therefore TextBox4 (or Label1)= 50

If TextBox2 =200000, then TextBox4 (or Label1) will then equal 100.

I would like for TextBox4 (Label1) to be updated automatically once the user
has moved the focus from TextBox3.

Is this possible?

Thanx in advance.
 
K

Kalpesh

Hi,

You can use the "AfterUpdate" or "Exit" event of the textbox to do the
processing

HTH
Kalpesh
 

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