VBA: Text Box Property (MASK?) (Easy Question)

  • Thread starter Thread starter Mcasteel
  • Start date Start date
M

Mcasteel

I want to create a "mask" for my text box, but Im not sure how, I dont
see a clearly labled property for this.

I simply want the text box to show as a Date format:

"__ / __ / ____"

Does anyone know the best way to do this?

Thank you.
 
Excel doesn't support this kind of masking.

But you could format your value nicely before you put it in the textbox (or
after it's entered, reformat it):

textbox1.text = format(date, "mm/dd/yyyy")

or

if isdate(textbox1.text) then
textbox1.text = format(textbox1.text, "mm/dd/yyyy")
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top