Rounding in MS Access

后端 未结 12 700
夕颜
夕颜 2020-11-28 14:23

Whats the best way to round in VBA Access?

My current method utilizes the Excel method

Excel.WorksheetFunction.Round(...

But I am l

12条回答
  •  星月不相逢
    2020-11-28 14:59

    1 place = INT(number x 10 + .5)/10
    3 places = INT(number x 1000 + .5)/1000
    

    and so on.You'll often find that apparently kludgy solutions like this are much faster than using Excel functions, because VBA seems to operate in a different memory space.

    eg If A > B Then MaxAB = A Else MaxAB = B is about 40 x faster than using ExcelWorksheetFunction.Max

提交回复
热议问题