I'm pretty sure it has something to do with my end if but I'm not really
used to excel programming.
Range("G24").Select
Do While ActiveCell <> 0
x = ActiveCell.Offset(-1, 0).Value
If ActiveCell.Value >= (x - (x * 0.06)) Then
If ActiveCell.Value <= (x + (x * 0.06)) Then
ActiveCell.Interior.ColorIndex = 35
ActiveCell.Font.ColorIndex = 1
End If
'HERE IS WHERE THE PROBLEM IS - it wont recognize the next elseif
statment. I just skips it. Everything else works fine, just not this
statement
'***********************************************
ElseIf ActiveCell.Value > (x + (x * 0.06)) Then
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Font.ColorIndex = 2
'***********************************************
ElseIf ActiveCell.Value < (x - (x * 0.11)) Then
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Font.ColorIndex = 2
Else
ActiveCell.Interior.ColorIndex = 36
ActiveCell.Font.ColorIndex = 1
End If
ActiveCell.Offset(0, 1).Select
Loop

Signature
evil baby
Tom Ogilvy - 28 Feb 2006 19:00 GMT
Range("G24").Select
Do While ActiveCell <> 0
x = ActiveCell.Offset(-1, 0).Value
If ActiveCell.Value >= (x - (x * 0.06)) or _
ActiveCell.Value <= (x + (x * 0.06)) Then
ActiveCell.Interior.ColorIndex = 35
ActiveCell.Font.ColorIndex = 1
ElseIf ActiveCell.Value > (x + (x * 0.06)) Then
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Font.ColorIndex = 2
ElseIf ActiveCell.Value < (x - (x * 0.11)) Then
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Font.ColorIndex = 2
Else
ActiveCell.Interior.ColorIndex = 36
ActiveCell.Font.ColorIndex = 1
End If
ActiveCell.Offset(0, 1).Select
Loop

Signature
Regards,
Tom Ogilvy
> I'm pretty sure it has something to do with my end if but I'm not really
> used to excel programming.
[quoted text clipped - 26 lines]
> ActiveCell.Offset(0, 1).Select
> Loop
evil baby - 28 Feb 2006 19:21 GMT
Thanks again for the help, wasn't sure how logical and/or worked in
VBA.
I had to change your 'Or' to an 'And' but it worked like a charm after
that.

Signature
evil baby
Tom Ogilvy - 28 Feb 2006 21:32 GMT
Glad you were able to figure it out.

Signature
Regards,
Tom Ogilvy
> Thanks again for the help, wasn't sure how logical and/or worked in
> VBA.
>
> I had to change your 'Or' to an 'And' but it worked like a charm after
> that.