Quick question, I'm using a If/ElseIf/EndIf structure on a project, and am running into a snag. I'm getting a "Compile Error - Else without If" when I use it. I've pasted a portion of the code (all the levels are essentially the same with only slight variations, so I cut out most of it to avoid the dreaded "wall of text").
Wondering if anyone can see what I've missed here? I'm self taught, so I'm sure it's probably something blindingly obvious to most folks, so please bear with me!
Thanks, David
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Do
If IsEmpty(ActiveCell) = False Then
If ActiveCell.Value >= Now() - 366 Then
Do
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
Selection.Font.Bold = True
Selection.Font.Underline = x1underlinestylesingle
ElseIf ActiveCell.Value >= Now() - 335 Then
Do
With Selection.Font
.Color = -4165632
.TintAndShade = 0
End With
Selection.Font.Bold = True
Else
Do
With Selection.Font
.Color = x1Automatic
.TintAndShade = 0
End With
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
End Sub