kylefoley76
Well-known Member
- Joined
- Mar 1, 2010
- Messages
- 1,553
Code:
Dim i As Range
Set i = Range("s2:s6")
For Each i In Range("s2:s6")
If i.Value < 3 Then MsgBox "a"
ElseIf i.Value > 3 And i.Value < 5 Then MsgBox "b"
Next i
I can't figure out what is wrong with the above code. The error message says "else without if"