Find common name over three columns

Jeff P

Board Regular
Joined
Jun 11, 2011
Messages
80
Hello, I'm In need of a script...


I have situation whereby i need to create a marker to identify specific names within a range.
the range spans C17:E292 ("Names_Range")



As an example, every row that the name "Bob" appears,(within the range) to place an "X" in the corresponding row under column "H"

C......D.....E....F....G....H

Bob...Mary..................X
...... Joe

Ted...Bob...................X
Fred..........Bob...........X



Thanks for any help!

Jeff
 
Could I impose with one small addition?

If I wanted to add another name to the script, how would i incorporate this?

ie I wanted to search for both Bob, and Marry

something like: (of course mine doesn't work..)


If e.Value = "Bob", "Marry" Then Cells(e.Row, "h") = "x"</pre>


thanks!

Jeff
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Could I impose with one small addition?

If I wanted to add another name to the script, how would i incorporate this?

ie I wanted to search for both Bob, and Marry ...

Jeff

Hi Jeff,

Maybe this modification
Rich (BB code):
Sub Sort_Names_Bob()
Dim lr&, e
With Range("C:E")
lr = .Find("*", searchorder:=xlByRows, _
        searchdirection:=xlPrevious).Row
    For Each e In .Resize(lr)
    If (e.Value = "Bob") + (e.Value = "Marry") Then Cells(e.Row, "h") = "x"
    Next
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,753
Members
452,940
Latest member
rootytrip

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