patty123467
New Member
- Joined
- Jul 24, 2015
- Messages
- 44
How can I create a code that will compare sheets and replace another column when there is a unique identifier found. Sheet 1 and 2, column A will contain a unique ID but they wont be in the same order. Sheet 1 and 2 will have column B containing non-unique data. I need for sheet 1 column B to be replaced with the text in sheet 2 column b when there is a unique ID found in column a on sheets 1 and 2. See below example.
Sheet 1</SPAN>
[TABLE="width: 128"]
<TBODY>[TR]
[TD]Test1</SPAN></SPAN>
[/TD]
[TD]Test2</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z123</SPAN></SPAN>
[/TD]
[TD]apple </SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z1234</SPAN></SPAN>
[/TD]
[TD]pear</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z12345</SPAN></SPAN>
[/TD]
[TD]banana </SPAN></SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
Sheet 2</SPAN>
[TABLE="width: 128"]
<TBODY>[TR]
[TD]Test1</SPAN></SPAN>
[/TD]
[TD]Test2</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z1234</SPAN></SPAN>
[/TD]
[TD]red</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z123</SPAN></SPAN>
[/TD]
[TD]blue</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z12345</SPAN></SPAN>
[/TD]
[TD]yellow</SPAN></SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
Apple would change to blue</SPAN>
Pear would change to red</SPAN>
banana would change to yellow</SPAN>
Sheet 1</SPAN>
[TABLE="width: 128"]
<TBODY>[TR]
[TD]Test1</SPAN></SPAN>
[/TD]
[TD]Test2</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z123</SPAN></SPAN>
[/TD]
[TD]apple </SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z1234</SPAN></SPAN>
[/TD]
[TD]pear</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z12345</SPAN></SPAN>
[/TD]
[TD]banana </SPAN></SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
Sheet 2</SPAN>
[TABLE="width: 128"]
<TBODY>[TR]
[TD]Test1</SPAN></SPAN>
[/TD]
[TD]Test2</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z1234</SPAN></SPAN>
[/TD]
[TD]red</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z123</SPAN></SPAN>
[/TD]
[TD]blue</SPAN></SPAN>
[/TD]
[/TR]
[TR]
[TD]z12345</SPAN></SPAN>
[/TD]
[TD]yellow</SPAN></SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
Apple would change to blue</SPAN>
Pear would change to red</SPAN>
banana would change to yellow</SPAN>