Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a UserForm with a textbox and I want to take the input value, format
it so two decimal places show at all times. Below is the line of code I am working with. If I input 100 into the textbox, the value in the cell shows as 100. It doesn't make any difference if it is currency with no $ or a number with two decimal places. ActiveCell.Value = Val(Format(Me.txtOrigPrice, "Standard")) Thank you. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you put the data into the worksheet it is going to use the formating of
the cell in the worksheet. You need to also change the formating in the activecell ActiveCell.Value = Val(Format(Me.txtOrigPrice, "Standard")) ActiveCell.NumberFormat = "0.00" "Billy B" wrote: I have a UserForm with a textbox and I want to take the input value, format it so two decimal places show at all times. Below is the line of code I am working with. If I input 100 into the textbox, the value in the cell shows as 100. It doesn't make any difference if it is currency with no $ or a number with two decimal places. ActiveCell.Value = Val(Format(Me.txtOrigPrice, "Standard")) Thank you. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Billy
ActiveCell.Value = Format(Val(Me.txtOrigPrice)),"0.00") OR ActiveCell.Value = Worksheetfunction.Round(Val(Me.txtOrigPrice)),2) If this post helps click Yes --------------- Jacob Skaria "Billy B" wrote: I have a UserForm with a textbox and I want to take the input value, format it so two decimal places show at all times. Below is the line of code I am working with. If I input 100 into the textbox, the value in the cell shows as 100. It doesn't make any difference if it is currency with no $ or a number with two decimal places. ActiveCell.Value = Val(Format(Me.txtOrigPrice, "Standard")) Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Very Simple formatting Question | Excel Discussion (Misc queries) | |||
Simple formatting question.... | Excel Discussion (Misc queries) | |||
Conditional formatting, simple question... | Excel Worksheet Functions | |||
Conditional formatting--simple question | Excel Worksheet Functions | |||
Simple? Formatting Question | Excel Programming |