Truncating and rounding off numbers in VBA

T

trekgoes2malaysia

Two simple questions that hopefully have simple solutions to them.

1) I want to truncate a number (34.6) so the end result only shows
34. I cannot find the function in VBA and its help service is of no
help? IS there one and if so what is it?

2) Also, is there a function for rounding off as well. I tried to set
the decmals property for an unbound textbox control to 1 but it has no
effect on the result numbers that come out (eg. 24.3245 instead of
24.3). Why is that and how can I solve this? I was thinking I could
use a roundoff function in VBA but can't find what it is or if it
exists at all.

Thanks in advance,
Patrick
 

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