Wonder if the last piece of code by Kalak has worked as I was working on a similar issue and found that I used a different approach.
At a high level the process is
- create a temporary worksheet to hold the results
- using the data worksheet use vlookup iteratively on each row to match A in B
- if a match exists then iteratively use vlookup across the remaining columns
- put he results from the vlookup into the temporary worksheet
- rename the temporary worksheet
I chose this approach for my piece of work because I had such a headache with shifting rows up and down, accidentally overwriting data or not clearing cells.
Below is the attached code and modified to work with your sample dataset that you provided with your first post.
I'm not sure if this is the most efficient method in terms of speed with regards to dictionary vs vlookup, but I guess is depends the size of your dataset.
If you have already found another solution then that is great.
Bookmarks