title: Formula IF with variables
body: <p>I would like to compare a cell value with a list of criteria using the length of each criteria and stop when the formula found a match</p>
  
  <p>so my logical is, do a cycle to compare when the locked cell is empty then go out of the cycle and end the macro but if the cell contain a value enter to the cycle after that with variables generate a formula with a loop repeat the formula (increase the row every time the loop runs) until the formula result is a valid value not FALSE then go out of the cycle and offset down one row and start the cycle again with the second value looked and the same till finish the list of values i need to look.</p>
  
  <p>so there is to list, one is the biggest one and there is another list of criteria.</p>
  
  <pre><code>C = 2
  For i = 1 To Range("D1")
      If IsEmpty(Sheets("Clean").Cells(i, 1)) = False Then
          For A = 2 To Range("I1")
          Do While (Sheets("Clean").Cells(C, 3)) = False
          Sheets("Clean").Cells(A, 3) = "=IF(LEFT(RC[-2],LEN(R&amp;C&amp;C10))=R&amp;C&amp;C10,RR&amp;C&amp;C10,FALSE)"
          Loop
          C = C + 1
          Next A
      End If
  Next i
  </code></pre>