(Solved) – How to search another sheet for a string and return value from column within that row [closed]


first time poster here.

First allow me to say that I know the rules and am not asking for anyone to write any code for me, I just need help locating a thread that may be of assistance to what I am trying to do. Or if there is a function that can perform the task that I am trying to perform.

I have coding experience and understand the logic and process of object oriented programming including creating loops. I am currently writing a code that will assist in scheduling at my manufacturing plant. We have a csv file that lists our items in order based on their piece ID (what makes this more difficult than just writing a for each loop in numerical order, is that not all piece ID’s are included as they may not have been scheduled at the time that the weekly report is being generated). With this code I will be migrating data from one of our spreadsheets that shows actual time worked on that piece ID, and migrate it to the other spreadsheet that shows the pieces bid time.

I know how to write a for each loop in order to work through the spreadsheet. What I need assistance with is how to search sheet2 for the current pieceID being used in to find the same piece in the workedHours sheet, and collect the value of the workedHours in that department for that specific piece.

The logic I am trying to perform:

12345          4.0            "refer to Sheet2, locate row containing Item ID 12345, and return column A as int"  
12378          3.9            "refer to Sheet2, locate row containing Item ID 12378, and return column A as int"  
12389          2.7            "refer to Sheet2, locate row containing Item ID 12389, and return column A as int"  

I can handle the looping mechanism, I just can’t seem to figure out how to begin searching for help with regards to how to search a column for the row that contains a specific value, then set a variable to the value from a prescribed column of that row

Leave a Reply

Your email address will not be published. Required fields are marked *