Preserving number format in userform textbox

R

Roger on Excel

Is there a way to preserve the number format that is in a userform text box
to be the same as the formatting in the sheet source cell

For example 85% in the sheet (percent format) reads 0.85 in the text box
that reads from that cell

Can anyone help?
 
J

Jacob Skaria

Try

Set rng = Range("A1")
TextBox1 = Format(rng,rng.NumberFormat)

If this post helps click Yes
 
R

Rick Rothstein

You can always assign the Text property of the range to the TextBox...

TextBox1.Value = Range("A1").Text
 

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