Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone pls help me... How do I get two decimals behind the input
and output number in the textboxed in my coding in VBA in th most easy way possible....? Have tried the Format "0.00" as someone suggested on the website here, but it did not work and I am not sure I am placing it in the right spot... Any suggestions would me welcome! Thanks Trine |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Trine
I'm not sure what you are trying to do exactly but the code below might help you with your problem. I set up a userform with two textboxes and a button to control the code, if a whole number is added to the first textbox when you click the button it will convert the number in textbox1 to a double and also add the number as a double in the second textbox. Option Explicit Dim MyNum As Double Private Sub CommandButton1_Click() MyNum = TextBox1.Value TextBox2.Value = Format(MyNum, "0.00") TextBox1.Value = Format(MyNum, "0.00") End Sub I hope this is of some help to you Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count digits before decimals and after decimals | Excel Worksheet Functions | |||
Decimals, how? | Excel Discussion (Misc queries) | |||
Decimals? | Excel Discussion (Misc queries) | |||
Numeric formatting: decimals and no decimals | Excel Programming | |||
decimals only. | Excel Discussion (Misc queries) |