title: find and replace for specific range in VBA
body: <p>I am using the following code for finding the curr_symbol and replacing it with new_symbol. Even though I have specified in the code that it should do so within the specific row numbers, it applies the find and replace to all the rows in the selected sheet, which is not what I want.</p>
  
  <pre><code>Sub find_replace()
  Dim curr_symbol, new_symbol As String
  Dim row_num, last_row As Integer
  row_num = ActiveSheet.Cells(1, "A").Value 'row_num=9
  last_row = ActiveSheet.Cells(2, "A").Value 'last_row=11
  
  Do While row_num &lt; last_row
        curr_symbol = ".ABC130301"
      new_symbol = ActiveSheet.Cells(row_num, "E").Value 'new_symbol=".BAC130306"
      With ActiveSheet.UsedRange
          .Replace curr_symbol, new_symbol, xlPart
      End With
  row_num = row_num + 1
  Loop
  End Sub
  </code></pre>
  
  <p>I even tried replacing the <code>With ActiveSheet.UsedRange....End With</code> with the following statement, but that also replaces the curr_symbol in all the rows.</p>
  
  <pre><code>ActiveSheet.Cells.Replace What:=curr_symbol, Replacement:=new_symbol, LookAt:=xlPart, _
                                SearchOrder:=xlByRows, MatchCase:=False, _
                                SearchFormat:=False, ReplaceFormat:=False
  </code></pre>
  
  <p>How can I fix this so it only replaces the string in the specified rows.</p>