TextBox1.value=TextBox2.value-(TextBox3.value+TextBox4.value)

H

helmekki

hi all

TextBox1.value=TextBox2.value- (TextBox3.value+TextBox4.value)

how to make this works in a code?

And the TextBox1 should show the result of the formula........

yours :confused:
 
D

Dave Peterson

textbox1.value = format(cdbl(textbox2.value) _
-(cdbl(textbox3.value)+cdbl(textbox4.value)),"000.00")
 
G

Guest

HI helmekki

If you like to declare varibles
here's another suggestion.
The code can be as crude as the following,
and will work on a form or sheet.

Private Sub CommandButton1_Click()

Dim box1 As Integer
Dim box2 As Integer
Dim box3 As Integer
Dim box4 As Integer
box1 = TextBox1.Value
box2 = TextBox2.Value
box3 = TextBox3.Value
box4 = TextBox4.Value

box1 = (box2 - (box3 + box4))

MsgBox box1, , "Good Luck TK"
TextBox1.Value = box1

End Sub

Good Luck TK


 

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