Hi Everybody,
I have a question for you. I have a workbook with two sheets. First one is main sheet with all the data and second one is kind of a description sheet. In the first sheet there are data's specify places but these are codes. For example SHANGHAİ comes as CNSHA. İn second sheet I define these places like below. What I want to do is loop through places in first sheet and replace them with second sheet's value. I've tried below code but it is not effective. I need your help.
I have a question for you. I have a workbook with two sheets. First one is main sheet with all the data and second one is kind of a description sheet. In the first sheet there are data's specify places but these are codes. For example SHANGHAİ comes as CNSHA. İn second sheet I define these places like below. What I want to do is loop through places in first sheet and replace them with second sheet's value. I've tried below code but it is not effective. I need your help.
First Sheet 'lets say A1 | First Sheet 'lets say B2 | Second Sheet ' lets say A1 | Second Sheet 'lets say A2 |
'some data | CNSHA | CNSHA | SHANGHAİ |
'some data | KRPUS | JPTYO | TOKYO |
'some data | JPTYO | KRPUS | BUSAN |
VBA Code:
Dim Rng as Range
For Each Rng in Range("B2:B"&cell(rows.count,2).end(xlup).row)
Rng.Value=Sheets(2).cells.find(rng.value).offset(0,1).value
Next Rng