• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Search every cell value from one column in another column and return output in desire columns

Dear All,

Kindly help me to solve below mention problem.
In column A- master code from A2 to A
In column B- master list of fruit from B2 to B
In column C - list of fruits based on user entry

Procedure - Search column B name in column C, if name of that fruit present in column C then copy name in column E2 and master code of that fruit in column F. So on for searching of all cells of column B in column C and return values in E and F.

Thanking you in advance.
 

Attachments

  • Book1.xlsx
    9.4 KB · Views: 10
Last edited:
Another option
Code:
Sub paneliyadhruv()
  Dim Cl As Range
 
  With CreateObject("scripting.dictionary")
      .CompareMode = 1
      For Each Cl In Range("C2", Range("C" & Rows.Count).End(xlUp))
        If Not Cl.Value = "" Then .item(Cl.Value) = Empty
      Next Cl
      For Each Cl In Range("B2", Range("B" & Rows.Count).End(xlUp))
        If .Exists(Cl.Value) Then .item(Cl.Value) = Cl.Offset(, -1).Value
      Next Cl
      Range("E2").Resize(.Count, 2).Value = Application.Transpose(Array(.Keys, .Items))
  End With
End Sub
 
Back
Top