Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default display special characters in some textbox fields to ensure data f

Hi All,

I have a excel userform which accepts user inputs and which is evevntually
saved in access database, In the userform i have textbox that accepts phone
numbers and money amounts. I want to display special characters in these
textbox fields to ensure data format.

For eg,

text box that accepts phone numbers, I want the textbox to display: "( )
- "
text box that accepts money amounts, I want to display a "$" sign before the
user input eg: $ 100,000
Also, is there a way to format the amount field such that it displays ","
and a "."
eg: 100,000,00.00

Hope I made it clear,

Thanks in advance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default display special characters in some textbox fields to ensure data f

Try the below..Adjust to suit your requirement..Also in tooltip you can
mention the format ..


Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1 = Format(TextBox1.Value, "$ #,##.00")
End Sub

Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox2 = Format(TextBox2.Value, "(###) ###-####")
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"sam" wrote:

Hi All,

I have a excel userform which accepts user inputs and which is evevntually
saved in access database, In the userform i have textbox that accepts phone
numbers and money amounts. I want to display special characters in these
textbox fields to ensure data format.

For eg,

text box that accepts phone numbers, I want the textbox to display: "( )
- "
text box that accepts money amounts, I want to display a "$" sign before the
user input eg: $ 100,000
Also, is there a way to format the amount field such that it displays ","
and a "."
eg: 100,000,00.00

Hope I made it clear,

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
Disallow special characters - Data Validation sccrsurfer Excel Discussion (Misc queries) 0 February 16th 12 07:28 PM
IMPORT DATA FROM WEB - WON'T DOWNLOAD SPECIAL CHARACTERS Sacs Excel Discussion (Misc queries) 3 March 8th 09 06:31 PM
Excel Count characters in a textbox to display character count? [email protected] Excel Programming 1 February 8th 07 06:31 AM
excel data label format special number characters (part 2) todd Excel Discussion (Misc queries) 1 May 4th 05 04:08 PM
excel data label format special number characters todd Excel Discussion (Misc queries) 0 May 4th 05 01:30 PM


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

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"