jgonzalez4
New Member
- Joined
- Jul 17, 2014
- Messages
- 3
I have two sheets (Sheet1, Sheet2). Sheet1 has data from Column A to Column P. Sheet2 has a different set of data from Column A to Column G. Column A in both sheets is an ID#. What I'm looking to do is have a macro that if the ID# in sheet2 Column A matches an ID# in Sheet1 Column A, put Sheet 2 Column B through G data into Sheet1 Column Q to V.
Please note that the ID#'s do not line up in the same row between Sheets 1 and 2.
Example:
Sheet1
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]First[/TD]
[TD]Last[/TD]
[TD]Age[/TD]
[/TR]
[TR]
[TD]101112[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]109854[/TD]
[TD]John[/TD]
[TD]Doe[/TD]
[TD]35[/TD]
[/TR]
[TR]
[TD]104695[/TD]
[TD]Jimmy[/TD]
[TD]Deen[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]456954[/TD]
[TD]Alice[/TD]
[TD]Wonderland[/TD]
[TD]30[/TD]
[/TR]
</tbody>[/TABLE]
Sheet2
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]Unit[/TD]
[TD]Enrollment Source[/TD]
[TD]Instrument[/TD]
[/TR]
[TR]
[TD]456954[/TD]
[TD]1[/TD]
[TD]ENT[/TD]
[TD]Guitar[/TD]
[/TR]
[TR]
[TD]109854[/TD]
[TD]6[/TD]
[TD]ENT[/TD]
[TD]Bass[/TD]
[/TR]
[TR]
[TD]659841[/TD]
[TD]3[/TD]
[TD]ENT[/TD]
[TD]Drums[/TD]
[/TR]
[TR]
[TD]101112[/TD]
[TD]4[/TD]
[TD]RT[/TD]
[TD]Voice[/TD]
[/TR]
</tbody>[/TABLE]
After the Macro:
Sheet1
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]First[/TD]
[TD]Last[/TD]
[TD]Age[/TD]
[TD]Unit[/TD]
[TD]Enrollment Source[/TD]
[TD]Instrument[/TD]
[/TR]
[TR]
[TD]101112[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]20[/TD]
[TD]4[/TD]
[TD]RT[/TD]
[TD]Voice[/TD]
[/TR]
[TR]
[TD]109854[/TD]
[TD]John[/TD]
[TD]Doe[/TD]
[TD]35[/TD]
[TD]6[/TD]
[TD]ENT[/TD]
[TD]Bass[/TD]
[/TR]
[TR]
[TD]104695[/TD]
[TD]Jimmy[/TD]
[TD]Deen[/TD]
[TD]19[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]456594[/TD]
[TD]Alice[/TD]
[TD]Wonderland[/TD]
[TD]30[/TD]
[TD]1[/TD]
[TD]ENT[/TD]
[TD]Guitar[/TD]
[/TR]
</tbody>[/TABLE]
Please note that the ID#'s do not line up in the same row between Sheets 1 and 2.
Example:
Sheet1
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]First[/TD]
[TD]Last[/TD]
[TD]Age[/TD]
[/TR]
[TR]
[TD]101112[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]109854[/TD]
[TD]John[/TD]
[TD]Doe[/TD]
[TD]35[/TD]
[/TR]
[TR]
[TD]104695[/TD]
[TD]Jimmy[/TD]
[TD]Deen[/TD]
[TD]19[/TD]
[/TR]
[TR]
[TD]456954[/TD]
[TD]Alice[/TD]
[TD]Wonderland[/TD]
[TD]30[/TD]
[/TR]
</tbody>[/TABLE]
Sheet2
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]Unit[/TD]
[TD]Enrollment Source[/TD]
[TD]Instrument[/TD]
[/TR]
[TR]
[TD]456954[/TD]
[TD]1[/TD]
[TD]ENT[/TD]
[TD]Guitar[/TD]
[/TR]
[TR]
[TD]109854[/TD]
[TD]6[/TD]
[TD]ENT[/TD]
[TD]Bass[/TD]
[/TR]
[TR]
[TD]659841[/TD]
[TD]3[/TD]
[TD]ENT[/TD]
[TD]Drums[/TD]
[/TR]
[TR]
[TD]101112[/TD]
[TD]4[/TD]
[TD]RT[/TD]
[TD]Voice[/TD]
[/TR]
</tbody>[/TABLE]
After the Macro:
Sheet1
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID#[/TD]
[TD]First[/TD]
[TD]Last[/TD]
[TD]Age[/TD]
[TD]Unit[/TD]
[TD]Enrollment Source[/TD]
[TD]Instrument[/TD]
[/TR]
[TR]
[TD]101112[/TD]
[TD]Jane[/TD]
[TD]Smith[/TD]
[TD]20[/TD]
[TD]4[/TD]
[TD]RT[/TD]
[TD]Voice[/TD]
[/TR]
[TR]
[TD]109854[/TD]
[TD]John[/TD]
[TD]Doe[/TD]
[TD]35[/TD]
[TD]6[/TD]
[TD]ENT[/TD]
[TD]Bass[/TD]
[/TR]
[TR]
[TD]104695[/TD]
[TD]Jimmy[/TD]
[TD]Deen[/TD]
[TD]19[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]456594[/TD]
[TD]Alice[/TD]
[TD]Wonderland[/TD]
[TD]30[/TD]
[TD]1[/TD]
[TD]ENT[/TD]
[TD]Guitar[/TD]
[/TR]
</tbody>[/TABLE]