Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GEM GEM is offline
external usenet poster
 
Posts: 90
Default how to format a label to 2 decimal places

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
worksheet is set up for 2 decimal places but format changes JT Spitz Excel Discussion (Misc queries) 2 September 8th 09 10:11 PM
format issues with decimal places Craig Upton Excel Discussion (Misc queries) 1 July 9th 08 07:51 PM
decimal places in format cell tom Excel Discussion (Misc queries) 2 February 16th 07 09:07 PM
Formula for: Format Decimal places? nastech Excel Discussion (Misc queries) 16 November 4th 05 02:25 PM
Format column to have different decimal places Branden Excel Programming 6 July 21st 05 05:44 PM


All times are GMT +1. The time now is 11:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"