Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default InputMask for Textbox in UserForm

Hi all,

I have textboxes that are used to get phones, dates, and currencies from the
user. How can I get the textboxes to have relevant input masks so that:

- instead of 2145559999, it'll be 214-555-9999 in the textboxes or (214)
555-9999
- instead of 091305, it'll be 09/13/05
- instead of 1234567.89, it'll be 1,234,567.89
????

Henry T

Of course the dashes or slashes or commas will be automatically added in the
textboxes as the users type along, instead of having the users type in the
formatting themselves.

Please help. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default InputMask for Textbox in UserForm

I don't know if there are input masks for excel. One workaround that works
for me with phone numbers and dates:

for phone numbers:
create 3 text boxes.
Set AutoTab to true for all three
Set max length to 3 for the first two boxes and 4 for the last
wherever the output for the form is place a concatenate in the code that
will place the formatted phone number in the cell.

Not the most streamline way of doing things, but it works.
(the same will work for date, just change the max lengths)


"Henry T" wrote:

Hi all,

I have textboxes that are used to get phones, dates, and currencies from the
user. How can I get the textboxes to have relevant input masks so that:

- instead of 2145559999, it'll be 214-555-9999 in the textboxes or (214)
555-9999
- instead of 091305, it'll be 09/13/05
- instead of 1234567.89, it'll be 1,234,567.89
????

Henry T

Of course the dashes or slashes or commas will be automatically added in the
textboxes as the users type along, instead of having the users type in the
formatting themselves.

Please help. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default InputMask for Textbox in UserForm

Thanks JNW, but I am really trying to find another way other than what you
suggested. So far, the solution is to manipulate the value with AfterUpdate
event. Wondering if it will work with Change event.

"JNW" wrote:

I don't know if there are input masks for excel. One workaround that works
for me with phone numbers and dates:

for phone numbers:
create 3 text boxes.
Set AutoTab to true for all three
Set max length to 3 for the first two boxes and 4 for the last
wherever the output for the form is place a concatenate in the code that
will place the formatted phone number in the cell.

Not the most streamline way of doing things, but it works.
(the same will work for date, just change the max lengths)


"Henry T" wrote:

Hi all,

I have textboxes that are used to get phones, dates, and currencies from the
user. How can I get the textboxes to have relevant input masks so that:

- instead of 2145559999, it'll be 214-555-9999 in the textboxes or (214)
555-9999
- instead of 091305, it'll be 09/13/05
- instead of 1234567.89, it'll be 1,234,567.89
????

Henry T

Of course the dashes or slashes or commas will be automatically added in the
textboxes as the users type along, instead of having the users type in the
formatting themselves.

Please help. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default InputMask for Textbox in UserForm

I understand...

If change doesn't work you may want to try the Exit event also.

"Henry T" wrote:

Thanks JNW, but I am really trying to find another way other than what you
suggested. So far, the solution is to manipulate the value with AfterUpdate
event. Wondering if it will work with Change event.

"JNW" wrote:

I don't know if there are input masks for excel. One workaround that works
for me with phone numbers and dates:

for phone numbers:
create 3 text boxes.
Set AutoTab to true for all three
Set max length to 3 for the first two boxes and 4 for the last
wherever the output for the form is place a concatenate in the code that
will place the formatted phone number in the cell.

Not the most streamline way of doing things, but it works.
(the same will work for date, just change the max lengths)


"Henry T" wrote:

Hi all,

I have textboxes that are used to get phones, dates, and currencies from the
user. How can I get the textboxes to have relevant input masks so that:

- instead of 2145559999, it'll be 214-555-9999 in the textboxes or (214)
555-9999
- instead of 091305, it'll be 09/13/05
- instead of 1234567.89, it'll be 1,234,567.89
????

Henry T

Of course the dashes or slashes or commas will be automatically added in the
textboxes as the users type along, instead of having the users type in the
formatting themselves.

Please help. Thanks.

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
TEXTBOX in USERFORM RUUD VAN DEURSEN Excel Programming 5 March 1st 05 03:36 PM
userform textbox Phil Excel Worksheet Functions 5 January 16th 05 06:59 PM
Textbox in userform Harald Staff Excel Programming 0 September 8th 04 11:51 AM
TextBox InputMask??? Stift[_38_] Excel Programming 2 June 24th 04 08:24 AM
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 05:20 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"