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: 8
Default Formatting in Text Boxes

hi - i have an issue with formatting text boxes...... i'm able to format text
boxes with code similar to below....in the userform initialize sub.....there
is another text box which is the sum of TX1 & TX2.....i place the sum line
before formatting and so this works perfectly when the userform opens....

Me.T.Value = Val(TX1 + Val(TX2)

Me.TX1.Value = Format(Me.TX1.Value, "#,##0")
Me.TX2.Value = Format(Me.TX2.Value, "#,##0")
Me.T.Value = Format(Me.TX2.Value, "#,##0")

however, TX1 and TX2 is an input box as well and i've got code to sum 1 & 2
using change event....

Private Sub TX1_Change()
Me.T.Value = Val(TX1 + Val(TX2)
End Sub

this doesnt seem to work becos the sum here is doen off the formatted number
and so the result is not correct....the sum works fine when i remove the
formatting during initialize...

i did a way to....
1. deformat TX1, TX2
2. perform sum of the two and place value back in T
3.reformat TX1, TX2, T after the sum has happened.


thx a lot for your help.
 
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
how to select multiple text boxes in excel for formatting Rob New Users to Excel 3 April 2nd 23 08:38 PM
Formatting Text Boxes & Label Captions in MultiPages Drummer361 Excel Programming 0 August 16th 06 01:09 AM
Formatting Text boxes for Date Entry [email protected] Excel Programming 1 May 2nd 06 07:53 PM
Allow Word type formatting in Excel text boxes bsassone Excel Discussion (Misc queries) 0 November 18th 05 02:24 AM
formatting text boxes doug Excel Programming 3 February 15th 05 06:53 PM


All times are GMT +1. The time now is 04:46 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"