• 0
Sign in to follow this  
Guest aco2000

Somar

Question

Guest aco2000

Gostaria dee saber como usurar uma TextBox1 e TextBox2 atribuir variavel como

Private Sub CommandButton1_Click()

a = TextBox1

b = TextBox2

c = a + b

TextBox3 = c

End Sub

fazer a soma e não juntar os numeros

[email protected]

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

que tal esse codigo

Private Sub Command1_Click()
Dim x As Integer
Dim y As Integer
Dim z As Integer
x = Str(Text1.Text)  'str transforma de texto para numero
y = Str(Text2.Text)
z = Str(x + y)


Text3.Text = (z)

End Sub

ve se é isso que você quer é ve se da certo, me avise!!!

qualquer duvida poste de novo

se você tiver outra duvidas dessas tem a seção de VB

ate mais

Share this post


Link to post
Share on other sites
  • 0
Guest Guest

Obrigado pela a dica mas so funcionou como esta abaixo

Private Sub Label1_Click()

Dim x As Integer

Dim y As Integer

Dim z As Integer

x = Val(TextBox1)

y = Val(TextBox2)

z = (x + y)

TextBox3 = (z)

Share this post


Link to post
Share on other sites
  • 0

aki en casa funfou normal

o que acontece de errado ao compilar?/

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this