View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_150_] dominicb[_150_] is offline
external usenet poster
 
Posts: 1
Default Text box in form


Hi raw

Well, it really depends on how your spreadsheet is set up.

Say, you're using UserForm1 and your textbox is called TextBox1 and you
have a macro calling Userform1:

Sub Test()
UserForm1.Show
End Sub

From the VBE double click on the UserForm you've designed and copy this
code into the pane that opens:

Private Sub UserForm_Initialize()
TextBox1.Text = Format(Range("Sheet1!G3").Value, "£#,###.00")
End Sub

Now, when you run the macro "Test", UserForm1 should open and TextBox1
will contain the value of G3 formatted in £ and pence.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=479531