+ Reply to Thread
Results 1 to 4 of 4

Need help with USERFORM adding extra data to an existing list

  1. #1
    Registered User
    Join Date
    06-13-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Need help with USERFORM adding extra data to an existing list

    Hello, I'm hoping someone can assist with my question.
    I have a list that contains dates, batch numbers and other various information. The sheet is normally password protected (but not in the attached file) so I've created a userform for the end user to modify existing records with, but they can't change any of the existing data.

    A batch will be checked for bacteria, and when the Microbiology report comes back from the lab, I need to be able to update our records for that batch number as to whether the product passes or fails. The problem is that there may be more than one entry in the list for that batch number (for example in the manufacturing process, we may have needed to make a slight batch adjustment and it will get re-tested hence another record for that batch number.

    The userform in the attached file prompts for the batch number to be entered, what VBA code do I need to add "Pass" or "Fail" to this record where the batch number matches what's in the USERFORM textbox, AND the Factory has released the product ("Interim Pass" in column K)? I've got comboboxes set up to only allow the "Pass" "Fail" options to be selected. I'm stuck on the code to find the correct record then write the "pass" "Fail" selections into that row

    In the example I'm trying to get the userform to differentiate from rows 8 and 9. The batch number is "000347" for both records, but row 8 had failed the quality testing. The code should write the combobox outputs into row 9 (columns M or N).

    I've been reading a lot about MATCH, INDEX functions but now my head is spinning and I need some expert advice to get me on the right track.
    Thanks in advance for your help!!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Need help with USERFORM adding extra data to an existing list

    Rather than search for a selected batch number you could use the listbox.listindex property to correlate the selected item to the worksheet database. The Pass/Fail variable could be assigned directly to the worksheets from the userform by combobox with the listindex indicating the row and having a fixed column.
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    06-13-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need help with USERFORM adding extra data to an existing list

    AndyLitch,
    I think your on a good line of thought here.
    I've got a userform now that uses a combobox and list box to try and pick out the selected record (batch number), however it's returning all records in my spreadsheet.
    I'd like to be able to select the record in the listbox (that shows a pass result) and then add a Pass result in the Micro combobox. This pass result needs to be added back into the original row in the original spreadsheet.

    Any assistance greatly appreciated
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Need help with USERFORM adding extra data to an existing list

    Sorry for the delay in replying but here is an example of what i mean. Look for it in the listbox1_Click event

    micro update.xlsm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding extra data to existing Macro
    By rushdenx1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2011, 04:40 AM
  2. adding extra text into an existing column
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-06-2005, 04:05 PM
  3. adding extra text into an existing column
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  4. adding extra text into an existing column
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  5. adding extra text into an existing column
    By Zach in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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