Dear All,
I am doing VBA Programming in Excel 2008, i am facing rounding issue in VBA coding, some times its taking rounding up and some times it is taking rounding down, please advise if any one have come across.
formulae:
round(tbl.field)+round(tbl.field)
Thanks in advance
Regards
John![]()
from microsoft helphttp://support.microsoft.com/kb/194983The Round() function in an Excel spreadsheet uses Arithmetic rounding, which always rounds .5 up (away from 0). The Round() function in Visual Basic for Applications 6, uses Banker's rounding, which rounds .5 either up or down, whichever will result in an even number.
you could try this which aaron blood posted at ozgrid
The ROUND formula can be restated as follows:
=ROUND(x,n)
=INT((x*10^n)+0.5)/10^n
The INT method is directly transportable to VBA.
Last edited by martindwilson; 01-10-2012 at 12:11 PM.
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks