Find cell value from activesheet in another workbook and update workbook using excel vba
Posted on 2012-08-14
I have two workbooks, a journal file which has the column “batch number” and a blank “Qty” columns F and G respectively. If there is a number in the batch number column it will be unique but, there may also be blanks. The second file is a csv file with the batch number equivalent in the “Data” column, column D, this column will not contain any blanks. What I would like to do is step through the csv file looking up each Data value in the journal file, if no exact match was found raise error, if there is an exact match, check the journal file Qty cell on the same row, if it is blank set it to 1, if it is not blank, raise error msg,.
I have a user form that prompts the user to open the journal file and then open the csv file. I write the path and file name of the journal file and the csv file, and the count of data records in the csv file to the form. I have the loop to step through the CSV file I just don’t know how to search just the journal file batch number column, how to return the journal file Qty cell and update it if it is blank.
Thanks in advance,