Insert row to main spreadsheet if record not found in sub workbook
Posted on 2013-06-07
I have a main workbook where I have all the unique salespeople . On a daily basis I receive an updated workbook which I call the sub workbook that has the most current salespeople. What I want to be able to do is via vba scan the sub workbook for all unique salespeople and compare to my main workbook. If the main workbook does not contain the salesperson found in the subworkbook then I would like to add this new salesperson to the main workbook. This new record would be added to the first empty row found in the main workbook.
Note each of my salespeople are unique by the field called social security number which is found in both the main and sub workbooks.
I have researched my need and it seems like I need to use the find function in order to do the compare of social security numbers in the main vs sub workbooks, but I am lost in terms of if I do not find the record how I find the last empty row in the main workbook and add the record found in the sub workbook.
I am on the train and have been unable to attach my 2 workbooks, but I assume this will not be a handicap in providing me with some guidance ?