+ Reply to Thread
Results 1 to 4 of 4

Excel 2003: Worksheet cells populate textboxes on a userform

  1. #1
    Registered User
    Join Date
    01-06-2013
    Location
    York, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Post Excel 2003: Worksheet cells populate textboxes on a userform

    Hi,

    I'm looking for some vba code that will lookup a reference number entered into a text box on a userform, goto a worksheet with the reference number coloum and stored data in, and then populate the assigned textboxes on the userform with the stored data for that reference number.

    I've actually found some code from within this forum posted previously, but the code wasn't taking the entered value and searching it against a specific column in a worksheet, just looking for the instance of that value across the entire sheet, which meant the results where varied.

    What would the code be in VBA to make it take an entered value in a textbox in a userform and to search it against a specific column in a worksheet, and then begin to take values from cells to the left to populate the textboxes on the userform?

    Edition of Excel using is 2003.

    Thanks in advance for any help.

    Regards

    Tom

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Excel 2003: Worksheet cells populate textboxes on a userform

    Hi,

    I have attached a workbook that gives an example of a user form that populates from a worksheet and then updates as reference numbers are change. In the example, if any of the fields change, all the other cells in the user form are updated. To initialize the macro to see the user form, press "<CTRL> a".

    Thanks,

    Daniel
    Attached Files Attached Files
    Last edited by djbomaha; 01-07-2013 at 02:47 AM.

  3. #3
    Registered User
    Join Date
    01-06-2013
    Location
    York, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel 2003: Worksheet cells populate textboxes on a userform

    Thank you for your reply, that sample spreadsheet works brilliant.

    But I could do with coding that specifically just retrieves data on a single textbox1.value, rather then the option of multiple comboboxes.

    So it just:
    A. Click on a cmd button looks at a value in a textbox
    B. Then using this value looks in a specific coloum in a worksheet
    C. Then retrieves the data from the corresponding cells to the right in the worksheet, to populate the textboxes on the userform

    ?

  4. #4
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Excel 2003: Worksheet cells populate textboxes on a userform

    Hi,

    Are you trying to pull data from a "textbox" or a "listbox"? A Listbox looks like a combobox without the dropdown arrow and you can just type in text. A "textbox" is used as headers on the user form typically and the user can't use them to input information. They can be changed, but there is no ability to use them for input. Do you have a file you can post that shows what you are trying to do? I used Excel 2003, so if you have one it needs to be saved in that version for me to be able to open it.

    Thanks,

    Dan

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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