How to get desired format in textbox linked to a cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a textbox linked to a cell via its controlsource property. The
cell's format is numeric with two decimals. If the value in the cell is 7,
the cell shows "7.00" but the text box shows "7"

How can I make the textbox show "7.00"?

Thanks.
 
Format it

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)
 
Thnks for the reply. I tried doing that just after after the textbox's
controlsource was set and immediately before the form was shown and it does
not work.

If the user changes the content of the textbox, I can format it in a
TextBox_Exit routine and it works fine, but that still leaves the initial
display incorrect.
 
Try it in the Userform_Activate() event.

--

HTH

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