PDA

View Full Version : ControlProperty



bforster007
02-14-2009, 07:48 PM
I am working with multiple sheets but I do not know how to popoulate a textbox from Sheet2.

Sheet2:C22

It does not work.

bforster007
02-14-2009, 07:50 PM
I am using the following code to format a textbox. Does not work at all.

Private Sub UserForm_Initialize()
TextBox1.Text = Format((TextBox1.Value),"$#,##0")
End Sub

Any thoughts?

Kenneth Hobs
02-14-2009, 08:41 PM
While not all cell numberformats will work like this, many will.

Private Sub UserForm_Initialize()
TextBox1.Text = Format(Sheet2.Range("C22").Value, Sheet2.Range("C22").NumberFormat)
'or
' TextBox1.Text = Sheet2.Range("C22").Text
End Sub