Rounding a Rounded Number
Hi Ken,
Dim your variables as Double, not Single
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
"Ken Hudson" wrote in message ...
| I'm working in Excel 2003 - VBA.
|
| OldRate is a variable whose value comes from user input into a cell.
| OldRate=Range("A1")
|
| I am multiplying that variable by 1.075 and need to round up the result to
| two decimal places.
| NewRate=Application.Worksheetfunction.Round(OldRat e * 1.075, 2)
|
| Then I need to multiply that rounded result by .25 and round it up to two
| decimal places.
| AdjustedNewRate=Application.Worksheetfunction.Roun d(NewRate * .25, 2)
|
| If $27.11 is the old rate, I would expect that $27.11 * 1.075 = $29.14
| (rounded).
| And $29.14 * .25 = $7.29 (rounded).
|
| However, I am getting $7.28 in VBA.
|
| How do I get VBA to give me $7.29?
|
| TIA.
|
| --
| Ken Hudson
|