title: Compile error: End If without block If
body: <p>I am currently running the below loop to pull out information from another spreadsheet, but keep getting the following error message <strong>Compile error: End If without block If</strong>, at </p>
  
  <pre><code>ElseIf cel.Offset(0, 8).Value = "" Then wshT.Cells(r, 14).Value = "Physical"
  </code></pre>
  
  <p>What could be causing it and how do I remediate it? My code below:</p>
  
  <pre><code>' Loop though cells in column A on main.xlsm
  For r = 1 To m
  
      ' Can we find the value in column A
      Set cel = wshS.Columns(3).Find(What:=wshT.Cells(r, 1).Value, _
      LookAt:=xlWhole, MatchCase:=False)
  
      If Not cel Is Nothing Then
          If cel.Offset(0, 8).Value = "Yes" Then wshT.Cells(r, 14).Value = "Virtual"
          ElseIf cel.Offset(0, 8).Value = "" Then wshT.Cells(r, 14).Value = "Physical"
          Else: End If
      End If
  Next r
  </code></pre>