In Sheet1 I have case-specific data (A is sitenumber, B is sitetypes that are present in the specific sitenumber):
A - B - C
1 - 1H31 - ...
1 - 1H71 - ...
1 - 1H93 - ...
2 - 2H34 - ...
Sheet2 contains general data about all sites, including the species that live there. Multiple species can occur per sitetype (C).
A - B - C
1 - 1H31 - Dog
1 - 1H31 - Cat
1 - 1H31 - Fly
1 - 1H34 - Rat
1 - 1H71 - Spider
....
57 - 57H23 - Dog
I want to do the following: If the sitetype in Sheet1,columnB matches the sitetype in Sheet2,columnB, the species from Sheet2,columnC should be added to Sheet1,columnC. HOWEVER, most of the time multiple matches can be found for the sitetypes in columns B. In those cases, I want to insert all these species in Sheet1 by inserting rows below the row where the first match was found.
So you would end up with this in Sheet1:
A - B - C
1 - 1H31 - Dog
1 - 1H31 - Cat
1 - 1H31 - Fly
1 - 1H71 - Spider
1 - 1H93 - Dog
1 - 1H93 - Butterfly
...
Anybody that can help me find either a formula of VBA-code for this? It has to link 2 sheets by looking up multiple values in Sheet2, inserting dito rows accordingly in Sheet 1 and then pasting multiple lookup / index-match values in these rows in Sheet1. ALSO, if NO species is listed in Sheet 2,column C, NO row should be inserted.
Hope its clear and thank you very much!
A - B - C
1 - 1H31 - ...
1 - 1H71 - ...
1 - 1H93 - ...
2 - 2H34 - ...
Sheet2 contains general data about all sites, including the species that live there. Multiple species can occur per sitetype (C).
A - B - C
1 - 1H31 - Dog
1 - 1H31 - Cat
1 - 1H31 - Fly
1 - 1H34 - Rat
1 - 1H71 - Spider
....
57 - 57H23 - Dog
I want to do the following: If the sitetype in Sheet1,columnB matches the sitetype in Sheet2,columnB, the species from Sheet2,columnC should be added to Sheet1,columnC. HOWEVER, most of the time multiple matches can be found for the sitetypes in columns B. In those cases, I want to insert all these species in Sheet1 by inserting rows below the row where the first match was found.
So you would end up with this in Sheet1:
A - B - C
1 - 1H31 - Dog
1 - 1H31 - Cat
1 - 1H31 - Fly
1 - 1H71 - Spider
1 - 1H93 - Dog
1 - 1H93 - Butterfly
...
Anybody that can help me find either a formula of VBA-code for this? It has to link 2 sheets by looking up multiple values in Sheet2, inserting dito rows accordingly in Sheet 1 and then pasting multiple lookup / index-match values in these rows in Sheet1. ALSO, if NO species is listed in Sheet 2,column C, NO row should be inserted.
Hope its clear and thank you very much!