title: VBA- adding character to .findnext in loop doesn't exit loop
body: <p>This code let's you change a value in one table, then looks for the original value('oldcode') in another range, if there's one or more occurrences in the 'other range', it replaces all of the oldcode with newcode.</p>
  
  <p>This works perfectly when taking away characters from newcode, however, when adding even one character to newcode, the loop never stops.  For example, if current (oldcode) is "Test", and I type "tes", the code fires and all of the "test" are changed to "tes".  If I change "Test" to "Test 1", all are changed to "Test 1", but the loop continues to run even though C is nothing after all are changed.  The if within the do doesn't seem to help.</p>
  
  <p>I should also mention oldcode is not directly "Test",  Oldcode actually comes from column 1, where it concats "test" and counts how many of them there, so "test-1". </p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <pre><code>Private Sub worksheet_change(ByVal target As Range)
  
  Dim row As Integer
  Dim column As Integer
  Dim i As Integer
  Dim oldcode As String
  Dim newcode As String
  Dim IssueLogSheet As Worksheet
  Dim FailureModeTable As Range
  Dim max As Integer
  
  
  Set IssueLogSheet = Sheets("Issue Log")
  Set FailureModeTable = IssueLogSheet.Range("FMCODE")
  
  row = target.row
  column = target.column
  
  
  
      If Not Intersect(target, FailureModeTable) Is Nothing And (target.column &lt;&gt; 1 Or target.column &lt;&gt; 4) Then
  
  
          Application.EnableEvents = False
          Application.Undo
          oldcode = Cells(row, 1).Value
          oldcode = WorksheetFunction.Proper(oldcode)
          Application.Undo
          Application.EnableEvents = True
          MsgBox oldcode
  
  
              With IssueLogSheet.Range("IssueLogFailureName")
              Set c = .Find(oldcode, LookIn:=xlValues)
  
                  If Not c Is Nothing Then
                  newcode = Cells(row, 1).Value
                  newcode = WorksheetFunction.Proper(newcode)
  
  
                      Do
                        If c Is Nothing Then
                        Exit do
                        End If
                      c.Value = newcode
                      Set c = .FindNext(c)
                      Loop While Not c Is Nothing
  
  
                  End If
  
            End With
  
        End If
  
  End Sub
  </code></pre>