title: Double click on cell and find value another sheet
body: <p>I am trying to search the web for VBA code that could help me, but I couldn't find anything.  </p>
  
  <p>What I trying to do:  </p>
  
  <ul>
  <li>In the same workbook, I have two sheets.  </li>
  <li>In sheet 1, a column A with lots values (numbers only).</li>
  <li>In sheet 2, a column A with these values (sometimes more than 1 time the same value) with many more information in other columns.</li>
  </ul>
  
  <p>So far, okay.</p>
  
  <p>What I need is, when I double click in one of these values from sheet 1, excel shows only the same values in sheet 2 (not only the first occurrence), hiding the others.</p>
  
  <p>Example:</p>
  
  <pre><code>Sheet 1
  Column A
  123
  124
  125
  126
  
  Sheet 2
  Column A
  123
  124
  123
  125
  123
  126
  </code></pre>
  
  <p>When clicking in cell with value 123 from sheet 1, excel shows the lines with the same value only in sheet 2, hiding the other values.</p>
  
  <p>I don't know how to code. However, this code I think, can be used. The only problem. It is returning the line number of the first occurrence in a pop up box. What I need is, Excel shows in the sheet the values founded.</p>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  
  'If you select more than one cell, ignore
  If Target.CountLarge &gt; 1 Then Exit Sub
  
  'If you select a blank cell, ignore
  If Target.Value = vbNullString Then Exit Sub
  
  Dim Finder, ClickRange
  
  'We want the event to fire if you click in column A anywhere
  Set ClickRange = Sheets("Sheet1").Range("A:A")
  
  'If you click somewhere else, ignore
  If Intersect(Target, ClickRange) Is Nothing Then Exit Sub
  
  'Look for the value in sheet 2 column A
  Set Finder = Sheets("Sheet2").Range("A:A").Find(Target.Value, LookAt:=xlWhole)
  
  'If we don't find it, Exit Sub
  If Finder Is Nothing Then Exit Sub
  
  'To display the row:
  MsgBox (Finder.Row)
  
  'To Select it:
  'If we find it, select sheet 2 and select the cell
  'Sheets("Sheet2").Activate
  'Finder.Select
  
  End Sub
  </code></pre>