I am VERY new to vba and usually use record macro for repetitive functions but can't do so in this case so need some help with coding. My question was deleted from another question site so I'm going to try to do a better job explaining, as I would really love the coding to make this work. I have multiple sheets that are named differently but all start with "ZZZ" (I will refer to as ZZZ sheets going forward). Each ZZZ sheet has Name1 in cell C2, Name2 in D2 and Name3 in E2. I need to search Name1, Name2 and Name3 on another sheet named Master and return data from the Master sheet. The Master sheet has Data-FullName-Address in column A and a Date in column B.
ZZZ_1234 sheet
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]ColumnA
[/TD]
[TD]ColumnB
[/TD]
[TD]ColumnC
[/TD]
[TD]ColumnD
[/TD]
[TD]ColumnE
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD] Name1
[/TD]
[TD] Name2
[/TD]
[TD]Name3
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Jon
[/TD]
[TD]Edward
[/TD]
[TD]Smith
[/TD]
[/TR]
</tbody>[/TABLE]
Master sheet[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ColumnA
[/TD]
[TD]ColumnB
[/TD]
[/TR]
[TR]
[TD]39208James D Wilson 549 Blue St, Asheville NC
[/TD]
[TD]10/12/17
[/TD]
[/TR]
[TR]
[TD]TR67Jonathon Graham 2390 Sixth St, Lynchburg VA
[/TD]
[TD]12/18/17
[/TD]
[/TR]
[TR]
[TD]87WFG98Edward James 6471 Jonas Lane, Nashville TN
[/TD]
[TD]2/17/18
[/TD]
[/TR]
[TR]
[TD]639UR2Jon R Smith 148 Main St, Chapel Hill, NC
[/TD]
[TD]9/25/17
[/TD]
[/TR]
</tbody>[/TABLE]
So for each ZZZ sheet, I want to search each name (Jon, Edward, Smith for this example) on the Master sheet in column A and if the name is found then copy data in A & B and paste it back to the ZZZ sheet starting in A4. There may be more than one match for each name. I would also like the results to bold the matched name, even if the match is part of the address (as shown in example). So for this example, sheet ZZZ_1234 would look like:
End Result for ZZZ_1234
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD]Column C
[/TD]
[TD]Column D
[/TD]
[TD]Column E
[/TD]
[/TR]
[TR]
[TD] 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 2
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Jon
[/TD]
[TD]Edward
[/TD]
[TD]Smith
[/TD]
[/TR]
[TR]
[TD] 3
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 4
[/TD]
[TD]TR67Jonathon Graham 2390 Sixth St, Lynchburg VA
[/TD]
[TD]12/18/17
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 5
[/TD]
[TD]87WFG98Edward James 6471 Jonas Lane, Nashville TN
[/TD]
[TD]2/17/18
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 6
[/TD]
[TD]639UR2Jon R Smith 148 Main St, Chapel Hill, NC
[/TD]
[TD]9/25/17
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
If none of the names on the ZZZ sheet are found on the Master then show "No Matches Found" on the ZZZ sheet in A4. Then loop to go to the next sheet name starting with ZZZ and
repeat the search for Name1, Name2 and Name3 on the Master sheet.
Thanks for any help!!
ZZZ_1234 sheet
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]ColumnA
[/TD]
[TD]ColumnB
[/TD]
[TD]ColumnC
[/TD]
[TD]ColumnD
[/TD]
[TD]ColumnE
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD] Name1
[/TD]
[TD] Name2
[/TD]
[TD]Name3
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Jon
[/TD]
[TD]Edward
[/TD]
[TD]Smith
[/TD]
[/TR]
</tbody>[/TABLE]
Master sheet[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ColumnA
[/TD]
[TD]ColumnB
[/TD]
[/TR]
[TR]
[TD]39208James D Wilson 549 Blue St, Asheville NC
[/TD]
[TD]10/12/17
[/TD]
[/TR]
[TR]
[TD]TR67Jonathon Graham 2390 Sixth St, Lynchburg VA
[/TD]
[TD]12/18/17
[/TD]
[/TR]
[TR]
[TD]87WFG98Edward James 6471 Jonas Lane, Nashville TN
[/TD]
[TD]2/17/18
[/TD]
[/TR]
[TR]
[TD]639UR2Jon R Smith 148 Main St, Chapel Hill, NC
[/TD]
[TD]9/25/17
[/TD]
[/TR]
</tbody>[/TABLE]
So for each ZZZ sheet, I want to search each name (Jon, Edward, Smith for this example) on the Master sheet in column A and if the name is found then copy data in A & B and paste it back to the ZZZ sheet starting in A4. There may be more than one match for each name. I would also like the results to bold the matched name, even if the match is part of the address (as shown in example). So for this example, sheet ZZZ_1234 would look like:
End Result for ZZZ_1234
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD]Column C
[/TD]
[TD]Column D
[/TD]
[TD]Column E
[/TD]
[/TR]
[TR]
[TD] 1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 2
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Jon
[/TD]
[TD]Edward
[/TD]
[TD]Smith
[/TD]
[/TR]
[TR]
[TD] 3
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 4
[/TD]
[TD]TR67Jonathon Graham 2390 Sixth St, Lynchburg VA
[/TD]
[TD]12/18/17
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 5
[/TD]
[TD]87WFG98Edward James 6471 Jonas Lane, Nashville TN
[/TD]
[TD]2/17/18
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 6
[/TD]
[TD]639UR2Jon R Smith 148 Main St, Chapel Hill, NC
[/TD]
[TD]9/25/17
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
If none of the names on the ZZZ sheet are found on the Master then show "No Matches Found" on the ZZZ sheet in A4. Then loop to go to the next sheet name starting with ZZZ and
repeat the search for Name1, Name2 and Name3 on the Master sheet.
Thanks for any help!!