title: Excel VBA Compile Error Else without If
body: <p>I try to run a code when column "L" and column "V" stated "Completed" on both. Then column "W" will show "Completed" else it will show "incompleted" but it show compile error "Else withou if".</p>
  
  <p>Below is my code</p>
  
  <pre><code>Sub OverallStatus()
  
  Dim x As Long
  Dim lastrow As Long
  
  With Sheet1
      If Application.WorksheetFunction.CountA(.Cells) &lt;&gt; 0 Then
           lastrow = .Cells.Find(What:="*", _
                       After:=.Range("A1"), _
                       Lookat:=xlPart, _
                       LookIn:=xlFormulas, _
                       SearchOrder:=xlByRows, _
                       SearchDirection:=xlPrevious, _
                       MatchCase:=False).Row
      Else
          lastrow = 1
      End If
      For x = 2 To lastrow
          If .Range("L" &amp; x) = "Completed" And .Range("V" &amp; x) = "Completed" Then
          .Range("W" &amp; x) = "Completed"
          Else: .Range("W" &amp; x) = "Incomplete"
          End If
      Next
  End With
  End Sub
  </code></pre>