format cell reference in a text box

G

Guest

How do I format the resulting number that is displayed in a text box? I
have used the linked cell property to define that cell C17 is what appears in
the text box. Cell C17 is a percentage. Currently it will display as
3.3333333333333E-2 for 3.33%. I would like it to appear in the text box as
3.33%. How do I limit the decimal places and add the % sign?

Thanks
 
G

Guest

Use the change event to reformat the textbox:

Private Sub Textbox1_Change()
Textbox1.Value = Format(Textbox1.Value,"0.00%")
End Sub
 
G

Guest

Thanks that did it!

Tom Ogilvy said:
Use the change event to reformat the textbox:

Private Sub Textbox1_Change()
Textbox1.Value = Format(Textbox1.Value,"0.00%")
End Sub
 

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