title: To skip a row containing the searchstring in excel VBA
body: <p>I have a loop for a spreadsheet which already has a bit of code in it. Basically in VBA what I want to do is:</p>
  
  <p><code>If x = Searchstring.row then GoTo continue</code> (which isn't defined)</p>
  
  <p>I am currently using <code>If x = activecell.row GoTo continue</code>, but when I add information to a new row the old cell is updated which includes the searchstring row (since it is no longer the <code>ActiveCell.row</code>)</p>
  
  <p>Below is the code I am using (sorry it is a bit messy):</p>
  
  <pre><code>Function RelLookup(ByVal Searchstring As String, Reldate As String, _
                  SearchRange As Range, TicketRange As Range, ReldateRange As Range, _
                  RelRange As Range, Optional UniqueOnly As Boolean = True)
  
  Dim X As Long, Task As String, ReldateVal As String, TicketVal As String, ReturnRel As String, _
  Result As String
  
  For X = 1 To SearchRange.Count
  If X = ActiveCell.row Then GoTo Continue
  
  
  Task = SearchRange(X).Value
  ReldateVal = ReldateRange(X).Value
  TicketVal = TicketRange(X).Value
  ReturnRel = RelRange(X).Value
  
  If (Task = Searchstring) And (ReldateVal = Reldate) Then
  Result = Result &amp; " Rel " &amp; ReturnRel &amp; " (" &amp; TicketVal &amp; ")" &amp; " &amp;"
  End If
  
  Continue:
  Next X
  
  If Len(Result) &gt; 0 Then RelLookup = Left(Result, Len(Result) - 2)
  
  
  End Function
  </code></pre>