Rounding a variable

  • Thread starter Thread starter Ling
  • Start date Start date
L

Ling

I have a question:
How do I round up a variable in VBA? I tried Round() but
it just removes the decimal places.
Eg: x = 0.90
(It should appear as 1)

Thanx for your help...
 
I think there is no built-in funtion to do that. You can use this expression

iif(x = int(x), x, x+1)

PS : if your email address is actual address, change it to any dummy
(example ling@nospam) before you send to any newsgroups Or it may captured
by spam virus. I just got a hundered of spam mails (Swen virus) in my
mailbox and can not use anymore after post to here. So, I have to leave the
old one and find a new address.

HTH
Suntisuk
 
thanx for ur help...
-----Original Message-----
I think there is no built-in funtion to do that. You can use this expression

iif(x = int(x), x, x+1)

PS : if your email address is actual address, change it to any dummy
(example ling@nospam) before you send to any newsgroups Or it may captured
by spam virus. I just got a hundered of spam mails (Swen virus) in my
mailbox and can not use anymore after post to here. So, I have to leave the
old one and find a new address.

HTH
Suntisuk




.
 
Back
Top