Match Codes in different sheet and replace it with next value

barissh

Board Regular
Joined
Aug 10, 2006
Messages
94
I have 2 sheets. in Sheet 1 there are some codes in 6 columns (G,H,I,J,K,L). And Sheet 2 contains codes (column A) and their full names (column B).

I need a macro which will find each codes in G,H,I,J,K,L in Sheet 2 column A and take its full name in column B and replace full name with its code in Sheet 1.

Since list is variable makro also should check blw situations

* Row address where codes are starting is variable. But the easiest way to find it, to find first full cell in column G and add 2 row down (i.e. if first full cell is G15, codes are starting from G17, H17,I17, etc).

* One of G,H,I,J,K,L cells may be empty. if any, pass next one (i.e. if G20 is empty, check H20. if it is also empty check I20)

* End of list. Since G,H,I,J,K,L cells may be empty, end of the list can be controlled from column A. All cells in column A is full and last cell contains a charachter as " " but this row does not contain any code !!!

thanks fr yr assist.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,215,869
Messages
6,127,415
Members
449,382
Latest member
DonnaRisso

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top