formatting text box if users input numbers

M

Marco

I created a user form that collects data.
There is a text box in which users can enter in text or numbers.
If the user enters in numbers is there VBA code that will make the entered
numbers show up in a specific format Ie: #,##0.00

Thanks
 
J

Jonathan West

Marco said:
I created a user form that collects data.
There is a text box in which users can enter in text or numbers.
If the user enters in numbers is there VBA code that will make the
entered
numbers show up in a specific format Ie: #,##0.00

You can use the Format function to format a string in a specific way. You
could call that function from the Exit event of the textbox, so that the
contents are reformatted when the user moves elsewhere.
 
M

Marco

Great idea...it worked perfectly.
Thanks

Jonathan West said:
You can use the Format function to format a string in a specific way. You
could call that function from the Exit event of the textbox, so that the
contents are reformatted when the user moves elsewhere.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
 

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

Top