title: Vlookup with If Statement
body: <p>I would like to use Vlookup function with If statement. My issue is if any rows in K columns equal to "Hatalı" then vlookup has to be begin according to the below parameters.</p>
  
  <p>For below code it gaves me compile error says "Next witout For" but I can not handle it. I will be glad if anyone can help me to resolve.</p>
  
  <pre><code>Sub FINDSource()
  
      On Error Resume Next
  
      Dim Dept_Row As Long
      Dim Dept_Clm As Long
  
      Table1 = Worksheets("RegScenario").Range("B9:B10000")
      Table2 = Worksheets("Source").Range("A1:C5000")
      Dept_Row = Worksheets("RegScenario").Range("M9").Row
      Dept_Clm = Worksheets("RegScenario").Range("M9").Column
  
  
  
          For Each cl In Table1
  
  
          If Worksheets("RegScenario").Range("K:K").Value = "Hatalı" Then
          Worksheets("RegScenario").Cells(Dept_Row, Dept_Clm) = Application.WorksheetFunction.VLookup(cl, Table2, 2, False)
          Dept_Row = Dept_Row + 1
          Next cl
          MsgBox "Done"
  
      End If
  
      End Sub
  </code></pre>