title: Find the next visible row
body: <p>I am trying to write a function to return the next visible row in an autofiltered list.</p>
  
  <p>In a sheet with an autofiltered range the code below returns a #VALUE error:</p>
  
  <pre><code>Function FindNextVisible(S As Range) As Range
  Dim L As Range
  Dim R As Range
  Dim counter As Integer
  counter = 1
  Set L = Range(S, S.End(xlDown)).Cells.SpecialCells(xlCellTypeVisible)
  For Each R In L
      counter = counter + 1
      If counter = 2 Then FindNextVisible = R
  Next 
  End Function
  </code></pre>
  
  <p>I suspect a beginners error...</p>
  
  <p><strong>UPDATE 1:</strong>
  Ok great advice. I can't use SpecialCells. Unfortunately the VBA is not strong in me and I'm having trouble with a Sub version.</p>
  
  <p>Perhaps there is another way. I want to compare text between non-contiguous (due to filtering) rows, but I don't know how to provide the formula with a reference to the next visible row.</p>