Question: it's me again. 

I have a nested for loop, looking at each cell within a range then moving onto the next column (needs to be nested, even for 2 as later on i have 300 columns and rows to check (this is a test attempt)) The macro checks the value of the cell then changes the color of the cell dependent on the value. However when i run the code, the macro colors everything with Color Index 36 irreverent of the value of the cell. Can anyone explain why?

```
Dim i12 as long 
Dim i9 as long 

i12 = 3
For i12 = i12 To 4
i12 = i12
i9 = 21
    For i9 = i9 To 71
        i9 = i9
        If 0 < Cells(i9, i12) < 1 Then
            Cells(i9, i12).Select
            Selection.Interior.ColorIndex = 36
        ElseIf Cells(i9, i12) < 0 Then
            Cells(i9, i12).Select
            Selection.Interior.ColorIndex = 3
        Else
        End If
    Next i9
Next i12

```

I'm thinking that the issue is from the `0 < Cells(i9, i12) < 1` here, maybe because VBA isn't able to cope with this equation, but i'm not sure. 
Thanks for any help you are able to provide .

Answer: 
Yes, you cannot do this, `If 0 < Cells(i9, i12) < 1 Then`.

You need two conditions,

```
If Cells(i9, i12) > 0 And Cells(i9, i12) < 1 Then

```

---

You also do not need to select the cell(s):

Replace

```
Cells(i9, i12).Select
Selection.Interior.ColorIndex = 3

```

with

```
Cells(i9, i12).Interior.ColorIndex = 3

```

(When you see `Select` followed by `.Selection` you can remove both terms.)
Like AndyG said, you need to define the condition twice in the IF statement, and use Interior.ColorIndex to set the color.