Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading Data from a Cell to a text box-user forms
There was a post about this recently, but I don't know where to put the
actual code! As you can tell I am somewhat of an amateur. I need a text box (TextBox70) in a user form to automatically reference a cell ("Index!B2") on a worksheet when the form opens. Any ideas on how to do this? I think the code is: TextBox70.Value = Sheets("Items").Range("a3").Value ....but not sure exactly where I need to paste it into the VB editor... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading Data from a Cell to a text box-user forms
Hello Mandle, The code you have is correct but not the references. It needs to be placed in the TextBox's Activate event procedure. 1) Copy the code below using CTRL+C. 2) Open the Workbook you will using the code in. 3) Press ALT+F11 to open the VBA Editor. 4) Click on the + (plus sign) next to Forms in the Project Explorer to display the forms in your project if they aren't listed. 5) Double Click TextBox 70. 6) Place the blinking cursor at the top left side of the listed code. 7) Press CTRL+V to paste it in. 8) Press CTRL+S to Save the changes. 9) Press ALT+Q to return to Excel. Code: -------------------- Private Sub UserForm_Activate TextBox70.Value = Sheets("Index").Range("B2").Value End Sub -------------------- Sincerely. Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=562314 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reading a cell that a user has clicked on | Excel Programming | |||
Reading data from a cell to a text box | Excel Programming | |||
Reading Data from a User Form. | Excel Programming | |||
Reading data from a user form into a sheet | Excel Programming | |||
Align text for labels in user forms | Excel Programming |