PDA

View Full Version : Solved: Message box Format??



Mr.G
07-20-2007, 05:56 AM
Hi all.
Could someone help or suggest.....
The doc. is similar to what I want. The problem that I have is, the display of the answer. I cannot get the display to only show or round the amount to the closest ".00". Even when you format the cells in excel it ,will display the correct amount in the cell but in the box it display's the full amount.

Any ideas??
Thanx.

daniel_d_n_r
07-20-2007, 06:00 AM
sorry i had posted an answer but later found it was useless,

Got me thinking, hope somone replys soon for you

at present, declaring the variable as an integer will round the number whole
but to set the decimal places I am ay=t a bit of a loss at the moment.


cheers

Mr.G
07-20-2007, 06:17 AM
Nope I can't get it intergrated into my code. Thanx

Bob Phillips
07-20-2007, 06:44 AM
Either



Private Sub ComboBox1_Change()
Range("B5").Value = ComboBox1.Value
TextBox1.Value = Format(Range("B6"), "#,##0.00")
End Sub


or



Private Sub ComboBox1_Change()
Range("B5").Value = ComboBox1.Value
TextBox1.Value = Range("D6").Text
End Sub

paulked
07-20-2007, 06:53 AM
One way:

In cell E6 =INT(B6*100)
In Cell D6 =E6/100

In
Private Sub ComboBox1_Change()
Range("B5").Value = ComboBox1.Value
TextBox1.Value = Range("B6")
End Sub

Change the Range("B6") to "D6"

Best Regards

Paul Ked

paulked
07-20-2007, 06:55 AM
I prefer XLD's :bow:

Mr.G
07-22-2007, 10:22 PM
Thank you
That works great.!!!