Find Match based on list

DBaker7777

Board Regular
Joined
Feb 3, 2009
Messages
53
Office Version
  1. 365
  2. 2016
I have a list of products on Sheet 1 column A. On sheet 2 I have data and in column A are various products. What I need is to look up each product on Sheet 1 and then for each instance it appears in Sheet 2 I need to update 9 columns over to a Yes each time it finds the name. Any help is appreciated.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
If you would provide (a) the version of Excel you are running and (b) update your profile to reflect the Excel version and (c) use XL2BB to show some of your data/sheets and expected results, it would help those trying to provide a solution.
 
Upvote 0
I am working with Office 365 currently. I cannot use XL2BB currently. I am posting this from my phone.
 
Upvote 0
Which columns become YES? What happens in those columns when the product name isn't found?
 
Upvote 0
So it is only looking up the values in Sheet 1 column A and trying to find all instances of that in column A of Sheet 2. When it finds an instance it will place a “Yes” in the 9th Column. All the other values are marked “No” currently. So as the user enters more values to Sheet 1 column A and run the macro it will then mark those as “Yes”.
 
Upvote 0
So I have searched and modified the following code, but it is only replacing the first instance when I need it to replace all if it finds 7 matches for the same name:


VBA Code:
Sub Macro4()
Dim cell as Range, rngFind as Range, counter As Long
With Sheets("Sheet1")
Set rngFind =.Range("A2"), .Range("A" & Rows.Count).End(xlUp))
End With
For each cell in rngFind
Set Found = Sheets("Sheet2").Range("A:A").Find(What:=cell.value, _
LookIn:=xlvalues, LookAt:=xlPart, MatchCase:=False)
If Not Found Is Nothing Then
Found.Offset(, 8).Value = "Yes"
counter = counter +1
End If
Next Cell
MsgBox "Replacements made: " &  counter,,"Replacements Complete"
End Sub



This is an example of what I need.

Sheet 1
Column A
Employee
John
Mary


Sheet 2
EmployeeData1Data2Data3Data4Data5Data6Data7Data8
JohnNo
MikeNo
JohnNo
BobNo
MaryNo
MaryNo
MaryNo
 
Upvote 0
In your example above for John and Mary, what and where do you expect your "yes" and "no" results?
 
Upvote 0
Sheet 1 is the list to look up on Sheet 2. So John and Mary are the values I am searching for on Sheet 2. I need it to find each instance and replace “No” with a “Yes” in the 8th column.
 
Upvote 0
That didn't answer my question. Should all occurrences of John and Mary on the 2nd sheet be YES and the others NO?
 
Upvote 0

Forum statistics

Threads
1,215,418
Messages
6,124,793
Members
449,189
Latest member
kristinh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top