How do I stop a Textbox in a Userform converting numbers?

A

Alan T

Probably a really stupid question... but how do I stop a Textbox on
userform from removing the leading zero on a number?

eg 01234567890 becomes 123456789
 
P

Peter atherton

Alan

You must format the cell first as text. e.g

Private Sub CommandButton1_Click()
Range("A6").NumberFormat = "@"
Range("A6").Value = TextBox1.Text
End Sub

Regards
Peter
 
Top