PDA

View Full Version : [SOLVED:] Cell looses format after number from User Form is placed in it.



TButhe
07-05-2005, 08:07 AM
I have a spreadsheet that has a User Form. I am using a text box to capture the user's beginning balance for this spreadsheet and other text boxes to capture some other info (facility name, month, facility number, etc). When the beginning balance is placed into the spreadsheet cell, it looses its formatting. If you look at the formatting on the cell it is correct. I have tried setting the formatting programatically but that doesn't seem to work. I am leaving this cell unlocked and if click it and then move off the cell, the formatting appears. Is this happening because I am using a text box to capture a number? What type of user form control should I use to capture a number? What am I doing wrong? :banghead:

sheeeng
07-05-2005, 08:11 AM
Could we have a look on the file?

TButhe
07-05-2005, 08:21 AM
Here is the file. I am just a beginner so my code is somewhat remedial. Any corrections/suggestions are welcome. :friends: Thanks!!

Norie
07-05-2005, 08:49 AM
Tracy

The attachment is protected.

TButhe
07-05-2005, 08:57 AM
forgot about that.:doh: Thanks.

Bob Phillips
07-05-2005, 09:35 AM
Try this button code



Private Sub CommandButton1_Click()
Range("C1").Value = TextBox1.Text
Range("C2").Value = TextBox2.Text
Range("C3").Value = TextBox3.Text
Range("G1").Value = TextBox4.Text
Range("G7").Value = TextBox5.Text
Range("B8").Select
CenterInfo.Hide
End Sub

TButhe
07-05-2005, 09:46 AM
Something simple!! Thanks xld and everyone!! I don't know what I would do without you all!! Would have given up a long time ago. :cloud9: :clap2: :biggrin:

I'm marking it solved.