I am a novice of Vba.
I have been litteraly fighting all day with this bit of code:

```
Sub ComandsCompactVisualization()
    Dim x, i As Integer
    Dim CellToAnalyse As Range

    x = 2
    i = 0

    For i = 0 To 5 Step 1
    Set CellToAnalyse = Worksheets("Comandi").Cells(x + i, 2)

        If Not CellToAnalyse.Font.ColorIndex = 2 Then
            Worksheets("Comandi").Rows("x+i:2").Hidden = True
        End If

    Next i
End Sub

```

I am trying to hide all the rows that in cell (x+i,2) have not got red text.
I am almost there but... Rows does not seem to accept as content Rows("x+i:2").

I obtain Runtime error 13 "Type mismatch".

If I substitute its content with Rows("2:2") row 2 is deleted but I am not any more able to hide all the other rows that do not have red text in column 2.

Ideas?