VBA to replace duplicate values with unique values from different column

TechnicalBeginer

New Member
Joined
Dec 27, 2021
Messages
2
Office Version
  1. 2003 or older
Platform
  1. Windows
Hello I have table like that:
1.1 Covid cases in hospitals per date. Column 6 is Hospitals with strings of the hospital names. There is like 40,000 of items.
1.2 In column 5 of this Sheet I have emty column, where the Hospitals IDs should be placed (like 40,000 items).
2. Now, in different sheet called Hospitals, I have list of hospitals, two columns. In column A I have hospitals IDs. In column B I have the strings of the hospitals, total 182 hospitals.
2.1 What I would like to do is to use these keys in column B, to compare with column 6 (Names of hospitals). If there is complete match of the string value, then copy the value from column A (from Hospitals) to column 5 (the ActiveSheet)

Can you help to do it? I am a newbie and I have no idea if is there such function in Excel 2002 or there is need to write it down as a more complex code.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Yet I have forget to add the point 3. On the final step I would like to replace the Strings of Hospitals in activeSheet With reference to the Hospitals! column B...
 
Upvote 0

Forum statistics

Threads
1,224,932
Messages
6,181,840
Members
453,068
Latest member
DCD1872

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