PRB: Round Function different in VBA 6 and Excel Spreadsheet (194983)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Excel 97 for Windows
This article was previously published under Q194983 SYMPTOMS
When using the Round() function in Visual Basic 6.0, a different result may
be returned than when using it in a cell formula of an Excel spreadsheet.
CAUSE
The VBA Round() function uses Banker's rounding while the spreadsheet cell
function uses arithmetic rounding.
RESOLUTION
Write a custom function to get the desired results.
STATUS
This behavior is by design.
REFERENCESFor additional information on rounding, click the article number below
to view the article in the Microsoft Knowledge Base:
196652 HOWTO: Implement Custom Rounding Procedures
Modification Type: | Minor | Last Reviewed: | 3/7/2005 |
---|
Keywords: | kbprb KB194983 |
---|
|