Trailing zeros in TextBox

  • Thread starter Thread starter ToddG
  • Start date Start date
T

ToddG

I have a userform with a series of TextBoxes linked to
individual cells in a WorkSheet. These cells contain
prices. I would like these TextBoxes to ALWAYS display the
trailing zero. i.e. if the cell contains 2.50 the TextBox
will always display 2.50. Anything i've tried so far will
display the zero but the next time the userform is
activated it goes back to 2.5. Any help is appreciated.
 
Todd,

Try

Textbox1.Text=Format(Textbox1.Text,"#,##0.00")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hello Bob,

Thank you for your reply. That is actually one of the
things I tried. When i exit out of the userform they
return to 2.5 the next time I show the userform. Could it
be the procedure? Which procedure would you use for this?

Again, thank you for your reply
 
Todd,

I don't know where you set the format or what, so it is difficult to
suggest. When I set that format on textbox_exit, and then hid the form, on
showing again the full format still showed.

Can you post the code?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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