Sarath Karanam
New Member
- Joined
- Mar 14, 2013
- Messages
- 41
Hi,
Can someone please let me know how to vlookup using VBA and meanwhile get all the adjacent cells if the condition matches.
Example:
Sheet 1:
<tbody>
</tbody>
Sheet 2:
<tbody>
</tbody>
How do I vlookup data from "Sheet 2" to "Sheet 1" and if the match is found, how can I get the adjacent cells without a need to vlookup for them too.
Here, the output should be:
<tbody>
</tbody>
Once the code finds that "IST" matches "India", it should copy the next 5 cells of "Sheet 2" to "Sheet 1" in the same order.
Thank you.
Sarath Karanam
Can someone please let me know how to vlookup using VBA and meanwhile get all the adjacent cells if the condition matches.
Example:
Sheet 1:
Location | Time Standard | Code 1 | Code 2 | Code 3 | Code 4 | Code 5 |
India | ||||||
USA |
<tbody>
</tbody>
Sheet 2:
Location | Time Standard | Code 1 | Code 2 | Code 3 | Code 4 | Code 5 |
England | GMT | a | b | a+b | a/b | a*b |
India | IST | c | d | c+d | c/d | c*d |
USA | EST | e | f | e+f | e/f | e*f |
Japan | JST | g | h | g+h | g/h | g*h |
<tbody>
</tbody>
How do I vlookup data from "Sheet 2" to "Sheet 1" and if the match is found, how can I get the adjacent cells without a need to vlookup for them too.
Here, the output should be:
Location | Time Standard | Code 1 | Code 2 | Code 3 | Code 4 | Code 5 |
India | IST | c | d | c+d | c/d | c*d |
USA | EST | e | f | e+f | e/f | e*f |
<tbody>
</tbody>
Once the code finds that "IST" matches "India", it should copy the next 5 cells of "Sheet 2" to "Sheet 1" in the same order.
Thank you.
Sarath Karanam