ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Question: User Form and input masks (https://www.excelbanter.com/excel-programming/342745-vba-question-user-form-input-masks.html)

MarianneR[_5_]

VBA Question: User Form and input masks
 

Hi!

I've created a User Form for people who are not experienced with Excel
The form includes text boxes as well as pull-downs (combo boxes).
was wondering if there was a way to use input masks (like in Access) t
prevent uses from entering inappropriate data.

For example, I have several date fields. Is it possible to have m
user form already have a mm/dd/yyyy format for them? Or, if that's no
possible, is there some way to make the User Form beep at them? I hav
prompts in the labels next to the boxes, but I'm afraid it won't b
enough.

The people on this forum have been so helpful. Thank you very much.

Sincerely,
Marianne :

--
Marianne
-----------------------------------------------------------------------
MarianneR's Profile: http://www.excelforum.com/member.php...nfo&userid=625
View this thread: http://www.excelforum.com/showthread.php?threadid=47595


Bob Phillips[_6_]

VBA Question: User Form and input masks
 
Marianne,

Date input masks are tricky.

I really had this correspondence with another poster that may help you

http://www.vbaexpress.com/forum/show...light=keypress

and also this one

http://tinyurl.com/9f9dg

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"MarianneR" wrote in
message ...

Hi!

I've created a User Form for people who are not experienced with Excel.
The form includes text boxes as well as pull-downs (combo boxes). I
was wondering if there was a way to use input masks (like in Access) to
prevent uses from entering inappropriate data.

For example, I have several date fields. Is it possible to have my
user form already have a mm/dd/yyyy format for them? Or, if that's not
possible, is there some way to make the User Form beep at them? I have
prompts in the labels next to the boxes, but I'm afraid it won't be
enough.

The people on this forum have been so helpful. Thank you very much.

Sincerely,
Marianne :)


--
MarianneR
------------------------------------------------------------------------
MarianneR's Profile:

http://www.excelforum.com/member.php...fo&userid=6253
View this thread: http://www.excelforum.com/showthread...hreadid=475954




Tom Ogilvy

VBA Question: User Form and input masks
 
No, there is no built in support for it. If you want to use code to
validate the input using the the change event or exit event, then that would
really be the only recourse. No ability to provide a mask.

Validating dates is pretty tough.

03/06/2005 is a valid date, but is it the one you want. Perhaps use a
calendar control for selecting dates.

--
Regards,
Tom Ogilvy


"MarianneR" wrote in
message ...

I should also mention that I'm a novice at VBA. Your patience is
appreciated.

Marianne


--
MarianneR
------------------------------------------------------------------------
MarianneR's Profile:

http://www.excelforum.com/member.php...fo&userid=6253
View this thread: http://www.excelforum.com/showthread...hreadid=475954





All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com