View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default how to format a label to 2 decimal places

Add a blank form and then drop a text box and a lebel onto the form. add this
code to the form. Run the form and type a number into the text box...

Private Sub TextBox1_Change()
If IsNumeric(TextBox1.Text) Then _
Label1.Caption = Format(TextBox1.Text, "#,##0.00")
End Sub
--
HTH...

Jim Thomlinson


"gem" wrote:

i have a label in an excel userform and need to format it as the numbers are
showing up as 139.9 when it should be 139.90 how do i do this?
thanks in advance