End If $ Else without block If error
Posted by Bob on October 24, 2000 12:30 PM
I am still relatively new to VBA, and don't understand why I keep getting End If without Block If and/or Else without If errors when I have an If Then statement above it. Here's an example I'm using:
For TL = 6 To 100
If Es1.Cells(TL, 5).Value <> "" Then ChkDel = MsgBox("WOULD YOU LIKE TO DELETE THE ENTRY FOR " _
& """" & Cells(TL, 5).Offset(0, -3).Value & """" & "?" & vbCr & vbCr & Cells(TL, 5).Value, _
vbYesNoCancel, "DELETE CONFIRMATION")
Select Case ChkDel
Case vbCancel
Exit Sub
Case vbYes
Cells(TL, 5).ClearContents
Case vbNo
End Select
'I tried putting End If here, and get the error message
Next TL
This macro works as is (without the End If), but I would like
to know how to solve this problem. Any help is greatly appreciated.