English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

If Check2 Then
A = 10 / 140
End If
If Check1 Or Check3 Then
A = 0
End If
This is the code on Tab one , the A information is pulled
over to Tab 14. Each tab has a question that is defined specific.

MyResult = A + B + C

But when this code is run it acts like it is in text. If the ans = 10+0+10 result 10010

2007-02-20 03:04:29 · 5 answers · asked by rebjr1954 1 in Computers & Internet Programming & Design

5 answers

Val(a+b+c)

(val will add them up. If there's a string still in there, it will return 0)

or Int(a+b+c)

(this is probably better to use)

2007-02-20 03:15:45 · answer #1 · answered by David B 4 · 0 0

first of all you need to declare your variables.

dim A as long
dim B as long
dim C as long
dim MyResult as long

if check2 then
a=10/140
elseif check1 or check3 then
a=0
end if

MyResult=A+B+C

if you want result to be a whole number, declare it myResult as Integer.

2007-02-20 11:59:58 · answer #2 · answered by Zlavzilla 3 · 0 0

You can download Visual Basic 2005 express edition free from microsoft.

2007-02-20 14:10:37 · answer #3 · answered by John W 3 · 0 0

check out http://www.pscode.com for great sample code...is it vb 4-16 bit, or vb 4-32 bit? Planet Source Code (the site I mentioned above) splits those two as separate categories.

2007-02-20 12:23:34 · answer #4 · answered by Richard H 7 · 0 0

Did you dimension A, B, C, as integers or strings? Looks like strings

2007-02-20 11:57:41 · answer #5 · answered by Grant d 4 · 0 0

fedest.com, questions and answers