Rounding a variable

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...
 
S

S.L.

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
 
L

ling

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




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top