LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Formatting number in a UserForm TextBox

The code below is doing what I want in incrementing an
interest rate in a text box by an 1/8 of a point. I would
like it to always display to 3 decimal places, but it goes:
5.125, 5.25, 5.375, 5.5, dropping trailing zeros.
I know it needs a Format. Any help is appreciated.

Private Sub UserForm_Activate()
txtInterestRate.Value = "5.000"
etc.
------------------------------------
Private Sub spnInterestRate_SpinUp()
txtInterestRate.Value = txtInterestRate.Value + 0.125
End Sub
-------------------------------------
Private Sub spnInterestRate_SpinDown()
txtInterestRate.Value = txtInterestRate.Value - 0.125
End Sub
 
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
Userform textbox number formats PhilM Excel Discussion (Misc queries) 2 June 7th 06 11:08 AM
userform textbox Phil Excel Worksheet Functions 5 January 16th 05 06:59 PM
Textbox number formatting Mike[_60_] Excel Programming 1 November 14th 03 10:03 PM
formatting text in TextBox in UserForm Kevin Excel Programming 2 November 7th 03 01:34 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 08:06 AM.

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"