What is the correct syntax for VB? I am trying to find if a number is > 1000 and is also equally divisable by 1000. So far I have...
...
Dim iAmount as Single
If iAmount > 1000 Then
MsgBox "Greater than 1000"
End If
...
Thank You
Printable View
What is the correct syntax for VB? I am trying to find if a number is > 1000 and is also equally divisable by 1000. So far I have...
...
Dim iAmount as Single
If iAmount > 1000 Then
MsgBox "Greater than 1000"
End If
...
Thank You
Try this:
Good luck!Code:Dim iAmount As Single
If (iAmount > 1000) And (iAmount Mod 1000 = 0) Then
MsgBox "Greater than 1000 and can be divided by 1000 without a remainder."
End If
Thank You
Try:
code:
select case amount/1000
case is =1
stuff for equal
case is >1
stuff for amount > 1000
case is =0
stuff for amount = 0
case is < 1
stuff for amount < 0
end select
If you wish to treat -1000 as = 1000 then use
abs(amount/1000)
Good Luck
DerFarm
If iAmount Mod 1000 = 0 Then
MsgBox iAmount & " is evenly divisible by 1000"
End If