Search from master list

Jake975

Board Regular
Joined
Feb 9, 2020
Messages
114
Office Version
  1. 2016
Platform
  1. Windows
I have an workbook I’m having an issue with on the first sheet1 I have a list of current names inA, on the second sheet2 I have the master list with search names inA and correct names inC.
Here is my issue:
Sheet1 inA i get a list of names these have unique text in the name.
Sheet2 inA i have the same list without unique identity text but matches part of the name from Sheet1.
i have tried Index & Match and Vlookup but i get mostly right answers and some wrong ones. For example if I put yum.pdf on sheet1 it’s returning a name that it shouldn’t. (Yum isn’t in master list)
i have also tried search but it can’t look in a different sheet.
Basically I want this to happen:
if part of the text in A1 on sheet1 match text from range on Sheet2 return info from same row two columns to the right where text was found. And so on down list on sheet1
DFFAE351-506E-4612-9092-30637E63A2C1.jpeg
6000BAC5-2AAD-4B53-A16A-994A8124E57B.jpeg
 
Try:
VBA Code:
Sub CompareNames()
    Application.ScreenUpdating = False
    Dim Rng As Range, WS1 As Worksheet, WS2 As Worksheet, desWS As Worksheet, fnd As Range
    Set WS1 = Sheets("Temp")
    Set WS2 = Sheets("Data List")
    For Each Rng In WS2.Range("C2", WS2.Range("C" & WS2.Rows.Count).End(xlUp))
        Set fnd = WS1.Range("A:A").Find(Rng, LookIn:=xlValues, lookat:=xlPart)
        If Not fnd Is Nothing Then
            fnd.Offset(, 1) = Rng.Offset(, 1)
        End If
    Next Rng
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
thank you that worked like a charm i couldn't figure out how to get it to work. Huge help thanks
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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