Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Decimal Places in TextBox

Hi,
I need to set a certain number of decimal places in a TextBox. Is there a
way to do this with code or in a property?
The TextBox is on a Form. The TextBox is used to display a number Value.
It is not linked to anything outside the form, IE: cells on a worksheet etc.

Thank you,
Amy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Decimal Places in TextBox

Amy, you could do something like this:

TextBox.Text = VBA.FormatNumber(Value,2)

where, in this example, 2 represents the number of decimal places that will
be shown in the text box.

"AMY Z." wrote:

Hi,
I need to set a certain number of decimal places in a TextBox. Is there a
way to do this with code or in a property?
The TextBox is on a Form. The TextBox is used to display a number Value.
It is not linked to anything outside the form, IE: cells on a worksheet etc.

Thank you,
Amy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Decimal Places in TextBox

Hi Paul,
Thank you for taking time to answer my question.
It doesn't work. It doesn't show an error, but won't display anything.
Do you know where I should enter the code?
Do I need to declare too? Using Dim?
This is what I have:
Private Sub TextBox3_Change()
TextBox3.Text =VBA.FormatNumber(Value,2)

I'm just learning how to program.
Thanks again if you come back to this post,
Amy

"Paul Mathews" wrote:

Amy, you could do something like this:

TextBox.Text = VBA.FormatNumber(Value,2)

where, in this example, 2 represents the number of decimal places that will
be shown in the text box.

"AMY Z." wrote:

Hi,
I need to set a certain number of decimal places in a TextBox. Is there a
way to do this with code or in a property?
The TextBox is on a Form. The TextBox is used to display a number Value.
It is not linked to anything outside the form, IE: cells on a worksheet etc.

Thank you,
Amy

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
Decimal places Tricia Excel Worksheet Functions 2 October 27th 08 03:14 AM
Subtracting two 2-decimal place numbers gives result 13-decimal places? [email protected] Excel Worksheet Functions 5 March 12th 07 10:38 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. SUKYKITTY Excel Discussion (Misc queries) 3 July 6th 05 01:50 PM
decimal places keyur Excel Programming 2 April 2nd 04 10:27 PM
UserForm TextBox Decimal Places pcsis Excel Programming 2 January 3rd 04 02:31 PM


All times are GMT +1. The time now is 04:26 AM.

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

About Us

"It's about Microsoft Excel"