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

2 answers

Number will have to be the actual number it is working it out from..and it might not work as a long and definately not an integer.

Number as String
Odd as Long (or Integer)
Even as Long ( or Integer)

If Not (Number <1 or Number > 10) Then
Number = Number / 2
If InStr(Number, ".5") then
Odd = Odd + 1
Else
Even = Even + 1
End If
End If
Me.Print "Odd: " & Odd & " - " & "Even: " & Even

2006-11-05 01:59:07 · answer #1 · answered by Aaron 5 · 0 0

Dim A As Integer (Or Long)
Dim Odd as Long (or Integer)
Dim Even as Long ( or Integer)

For A= 1 to 10

if (A/2)=Int(A/2) then
Even=Even+1
else
Odd=Odd+1
end if

Next

Me.Print "Odd: " & Odd & " - " & "Even: " & Even

--------------
If it looks like I swiped some code from the dude above, It's 'cause I did.

2006-11-07 09:32:26 · answer #2 · answered by scothran50 1 · 0 0

fedest.com, questions and answers