+ Reply to Thread
Results 1 to 2 of 2

Reading Data from a Cell to a text box-user forms

  1. #1

    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. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    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.

    Please Login or Register  to view this content.
    Sincerely.
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1