Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sat, 24 Jul 2004 17:19:15 -0400, "Otto Moehrbach"
wrote: Excel 2002, WinXP I have the 3 following lines of code: MsgBox Round(SumGrossReturn - 1, 3) DestPut.Offset(, 6) = Round(SumGrossReturn - 1, 3) DestPut.Offset(, 6).NumberFormat = "0.0%" The message box returns 0.227 The destination cell gets 22.6999999999% Why doesn't the destination cell get 22.7% ? Thanks for your help. Otto Perhaps there is something else going on in your code. The following seems to work just fine for me, with 0.227 showing in the message box, and 22.7% appearing in G6. ========================= Sub TestRound() Dim DestPut As Range Const SumGrossReturn As Double = 1.226999999 Set DestPut = [A6] MsgBox Round(SumGrossReturn - 1, 3) DestPut.Offset(, 6) = Round(SumGrossReturn - 1, 3) DestPut.Offset(, 6).NumberFormat = "0.0%" End Sub ======================== --ron |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
ROUNDING FORMULA =ROUND(B12/$B$10,1) ROUNDING TO HIGH | Excel Worksheet Functions | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
I need a formula with rounding up & rounding down to the nearest . | Excel Worksheet Functions | |||
Rounding questions: (Formula and Code) ? | Excel Programming |