kshitij_dch
Active Member
- Joined
- Apr 1, 2012
- Messages
- 362
- Office Version
- 365
- 2016
- 2007
- Platform
- Windows
Hi,
I have a workbook in which sheet 1 has few ID and name with details and sheet 2 is having list of ID and name with details .
Looking for a macro which will match the ID in sheet1 with sheet2 , if ID matches then look for the amount in column D if amount is same in both the sheets then copy the place and name from sheet 2 to sheet1
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 256, colspan: 4"]Sheet 1[/TD]
[/TR]
[TR]
[TD="class: xl63"]ID[/TD]
[TD="class: xl63"]Names[/TD]
[TD="class: xl63"]Place [/TD]
[TD="class: xl63"]Amount[/TD]
[/TR]
[TR]
[TD="class: xl63"]11[/TD]
[TD="class: xl63"]Antony[/TD]
[TD="class: xl63"]Texas[/TD]
[TD="class: xl63"]231[/TD]
[/TR]
[TR]
[TD="class: xl63"]22[/TD]
[TD="class: xl63"]Rodger[/TD]
[TD="class: xl63"]Mexico[/TD]
[TD="class: xl63"]-639[/TD]
[/TR]
[TR]
[TD="class: xl63"]33[/TD]
[TD="class: xl63"]Marcos[/TD]
[TD="class: xl63"]USA[/TD]
[TD="class: xl63"]-300[/TD]
[/TR]
[TR]
[TD="class: xl63"]44[/TD]
[TD="class: xl63"]Lily[/TD]
[TD="class: xl63"]Brazil[/TD]
[TD="class: xl63"]500
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 250"]
<colgroup><col span="2"><col><col></colgroup><tbody>[TR]
[TD="colspan: 4"]Sheet 2[/TD]
[/TR]
[TR]
[TD]ID[/TD]
[TD]Names[/TD]
[TD]Place [/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Antony[/TD]
[TD]Brazil[/TD]
[TD]231[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Antony[/TD]
[TD]USA[/TD]
[TD]-231[/TD]
[/TR]
[TR]
[TD]44[/TD]
[TD]Lily[/TD]
[TD]Texas[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]Marcos[/TD]
[TD]Mexico[/TD]
[TD]-300[/TD]
[/TR]
[TR]
[TD]44[/TD]
[TD]Lily[/TD]
[TD]Hungary[/TD]
[TD]-231[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]Rodger[/TD]
[TD]Texas[/TD]
[TD]639[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]Rodger[/TD]
[TD]Hungary[/TD]
[TD]-639[/TD]
[/TR]
</tbody>[/TABLE]
I have a workbook in which sheet 1 has few ID and name with details and sheet 2 is having list of ID and name with details .
Looking for a macro which will match the ID in sheet1 with sheet2 , if ID matches then look for the amount in column D if amount is same in both the sheets then copy the place and name from sheet 2 to sheet1
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 256, colspan: 4"]Sheet 1[/TD]
[/TR]
[TR]
[TD="class: xl63"]ID[/TD]
[TD="class: xl63"]Names[/TD]
[TD="class: xl63"]Place [/TD]
[TD="class: xl63"]Amount[/TD]
[/TR]
[TR]
[TD="class: xl63"]11[/TD]
[TD="class: xl63"]Antony[/TD]
[TD="class: xl63"]Texas[/TD]
[TD="class: xl63"]231[/TD]
[/TR]
[TR]
[TD="class: xl63"]22[/TD]
[TD="class: xl63"]Rodger[/TD]
[TD="class: xl63"]Mexico[/TD]
[TD="class: xl63"]-639[/TD]
[/TR]
[TR]
[TD="class: xl63"]33[/TD]
[TD="class: xl63"]Marcos[/TD]
[TD="class: xl63"]USA[/TD]
[TD="class: xl63"]-300[/TD]
[/TR]
[TR]
[TD="class: xl63"]44[/TD]
[TD="class: xl63"]Lily[/TD]
[TD="class: xl63"]Brazil[/TD]
[TD="class: xl63"]500
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 250"]
<colgroup><col span="2"><col><col></colgroup><tbody>[TR]
[TD="colspan: 4"]Sheet 2[/TD]
[/TR]
[TR]
[TD]ID[/TD]
[TD]Names[/TD]
[TD]Place [/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Antony[/TD]
[TD]Brazil[/TD]
[TD]231[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Antony[/TD]
[TD]USA[/TD]
[TD]-231[/TD]
[/TR]
[TR]
[TD]44[/TD]
[TD]Lily[/TD]
[TD]Texas[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]Marcos[/TD]
[TD]Mexico[/TD]
[TD]-300[/TD]
[/TR]
[TR]
[TD]44[/TD]
[TD]Lily[/TD]
[TD]Hungary[/TD]
[TD]-231[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]Rodger[/TD]
[TD]Texas[/TD]
[TD]639[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]Rodger[/TD]
[TD]Hungary[/TD]
[TD]-639[/TD]
[/TR]
</tbody>[/TABLE]