+ Reply to Thread
Results 1 to 11 of 11

How can I active a row from a listbox in a user form?

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    6

    How can I active a row from a listbox in a user form?

    Hello
    I am an amateur at this stuff, so any help is greatly appreciated.
    I currenly have a user form that enters some basic information into the next empty row in my worksheet. I now need to create a second form to be used later in the process, adding additional information. I'd like to have people be able to pick a job number from a listbox in the new form, and have that activate the row that the original information is stored. The listbox would be populated by the data in the column of the sheet containing the job number. This way, when the folks identify which job they are working on, the rest of the data being entered from the second form will be placed into the correct row. Once again, any help is greatly needed and appreciated.

  2. #2
    Registered User
    Join Date
    01-04-2013
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: How can I active a row from a listbox in a user form?

    Hi Magma,

    I am like you. Searching for the same like you do. Maybe we can work together?

    Greetings

    Bastian

  3. #3
    Registered User
    Join Date
    01-02-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How can I active a row from a listbox in a user form?

    Hi Bastian
    Not sure how much I can contribute. My company is too small to have any IT support, so if I want to collect data, I'm on my own. Unfortunately, all of my knowledge has been self taught, and not knowing the subject matter makes that a difficult task. If I have any breakthroughs or suggestions, I'll send them your way to see what you think.

    John

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    You might be able to use the ListIndex of the listbox to find the relevant row.

    Then you can populate the userform with the data for the selected record/job.

    Can you attach a sample workbook?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    01-02-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How can I active a row from a listbox in a user form?

    Hi Norie
    I have attached the workbook as requested with a couple of lines of sample data. The information in red is what needs to activate the row for the balance of the data to be entered, and is the information currently populating the listbox in the second user form, the assembly labor entry form. Thanks in advance for your help.
    Attached Files Attached Files

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How can I active a row from a listbox in a user form?

    Have a look at the attached.

    I've only done the code for the first 3 textboxes but you should be able to work it out for the rest.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-02-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How can I active a row from a listbox in a user form?

    Norie
    That works really well. I did come across one problem, and I'm sure it is because i didn't explain myself as well as I should have. Entering data into a row is not a one time shot, other people will be making entries into the same row at a later date. Unfortunately, when I try to do this, it erases any previous data. Is there a way to keep what was entered, while adding new information?
    Thanks for getting me this far!

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How can I active a row from a listbox in a user form?

    Just add code to check if there's data already there.

    Or add code to load what's already there into the userform when a work order number is selected.

    That code would basically just be the reverse of the code to put the value on the worksheet.
    Please Login or Register  to view this content.
    If you use the 2nd option you would need to change the code that puts the data on the worksheet.

  9. #9
    Registered User
    Join Date
    01-02-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How can I active a row from a listbox in a user form?

    I worked on this over the weekend and had no luck. Which of the 2 options mentioned would be the easier route? I wasn't sure what sort of changes would be needed to enter the data to the sheet using the second method.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How can I active a row from a listbox in a user form?

    That's the thing you would only need a slight change to the existing code so that instead of writing from the userform to a new row it writes to an existing row.

  11. #11
    Registered User
    Join Date
    01-02-2013
    Location
    Massachusetts
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How can I active a row from a listbox in a user form?

    Thanks for everything, it is up and running just the way I needed it to be. I appreciate all of your help!

+ 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