Adamzurick
New Member
- Joined
- Jun 26, 2008
- Messages
- 20
Hi all, I'm new to VBA and while trying to learn this new language, need to figure out a way to do something for work ahead of my current skill level.
I have two sheets, in each there are hundreds of rows of the three columns listed below (I'm only using 1 row but would need this using a range). Using Sheet 1 as the key, I want to replace Sheet 2 column B and C wherever the name matches all occurrences.
I think I found what code to use, I just don't know how to use it "TextRange2.Replace". Any help would be WONDERFUL!!!
[TABLE="width: 416"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Sheet 1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Region[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]America[/TD]
[TD]New York[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sheet 2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Region[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]Spain[/TD]
[TD]Madrid[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sheet 2 (After Macro)[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Region[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]America[/TD]
[TD]New York[/TD]
[/TR]
</tbody>[/TABLE]
I have two sheets, in each there are hundreds of rows of the three columns listed below (I'm only using 1 row but would need this using a range). Using Sheet 1 as the key, I want to replace Sheet 2 column B and C wherever the name matches all occurrences.
I think I found what code to use, I just don't know how to use it "TextRange2.Replace". Any help would be WONDERFUL!!!
[TABLE="width: 416"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Sheet 1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Region[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]America[/TD]
[TD]New York[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sheet 2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Region[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]Spain[/TD]
[TD]Madrid[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sheet 2 (After Macro)[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]Region[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]America[/TD]
[TD]New York[/TD]
[/TR]
</tbody>[/TABLE]