View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Adamson[_4_] David Adamson[_4_] is offline
external usenet poster
 
Posts: 61
Default decimal places in currency

I just don't understand this.

When using the following 2 peices of code in a userform I cna format the
data to how I want it so as I'm typing in the data it displays in the
correct format I'm after.

Private Sub MaxQ_Change()
MaxQ = Format(MaxQ, "#,###")
End Sub

Private Sub MeanVC_Change()
MeanVC = Format(MeanVC, "$#,###")
End Sub

So in MaxQ_Change I type 10000, I get 10,000 appear as I'm typing

For in MeanVC_Change I type 15125, I get $15,125 appear.


But for the life of me I can not find a way to put decimals into the values,
where I want them

For example if I try
MeanVC= format(MeanVC, "$#,###.##) and I type 51, I get $5.1 and not $51.00
as I'm, after.

How can I type 51.65 into a textbox and get $51.65?

Thanks in advance