title: Excel VBA find a range of same values in a column
body: <p>I need to write a macro that will find the cell range based on a value. A column will have the same value in a row, I need to find out what is the first and last column that has the same value in a row.<img src="https://i.stack.imgur.com/7556s.png" alt="enter image description here"></p>
  
  <p>So the macro needs to find that "Jill Cross" range is a4 to a9</p>
  
  <p>So far I don't have much, got a way to find the first occurrence of a value</p>
  
  <pre><code>   Function GetFirstCell(CellRef As Range)
     Dim l As Long
     l = Application.WorksheetFunction.Match(CellRef.Value, Range("A1:A10000"), 0)
     GetFirstCell = l
     End Function
  </code></pre>
  
  <p>Now I need to loop through the next rows somehow to return the last row of an occurrence</p>