Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formating currency in text box
This is the code I got yesterday, but I'm still having
problems. Private Sub txtHouseCost_AfterUpdate() txtHouseCost.Value = Format(CInt(txtHouseCost.Value), "# ##0 $") End Sub When I enter a number it rounds up or down, I lose the digits after the decimal, and the $ is at the left end of the number. The other problem I have is if I move the $ to the front, $# ##0 , the total doen't work. I'm using Total = Val(txtHouseCost.Value) + Val(txtLotCost.Value) + Val(txtOptionCost.Value) Any ideas to help this old struggling newbie? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formating currency in text box
Doug
Doug wrote: This is the code I got yesterday, but I'm still having problems. Private Sub txtHouseCost_AfterUpdate() txtHouseCost.Value = Format(CInt(txtHouseCost.Value), "# ##0 $") =Format(txtHouseCost.Text, "$#,##0.00") End Sub When I enter a number it rounds up or down, I lose the digits after the decimal, and the $ is at the left end of the number. The other problem I have is if I move the $ to the front, $# ##0 , the total doen't work. I'm using Total = Val(txtHouseCost.Value) + Val(txtLotCost.Value) + Val(txtOptionCost.Value) Total = CDbl(txtHouseCost.Text) + CDbl(txtLotCost.Text) etc... -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Currency formating | Excel Discussion (Misc queries) | |||
Formating numbers &"Text" to appear as currency &"Text" in formula | Excel Discussion (Misc queries) | |||
Conditional Formating - Currency | Excel Discussion (Misc queries) | |||
Currency formating problem | Excel Discussion (Misc queries) | |||
Currency formating problem | Excel Discussion (Misc queries) |