You have an extra letter r attached :)
.Interior.Color = vbRed .Interior.Color = RGB(255, 0, 0) .Interior.Color = 255
Work with leaf objects is slow. If there are a lot of cells and you need to fill it with a whole range, you can process in memory and fill the cells with one command.
Sub PaintCells() Dim r1 As Range, r2 As Range Dim c As Range Set r1 = Range("A1:C10") ' Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Π² ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ r1.Interior.Pattern = xlNone ' ΡΠ±ΠΈΡΠ°Π΅ΠΌ Π·Π°Π»ΠΈΠ²ΠΊΡ ' r1.Interior.ColorIndex = 0 ' ΠΈΠ»ΠΈ ΡΠ°ΠΊ For Each c In r1 ' ΡΠΈΠΊΠ» ΠΏΠΎ ΡΡΠ΅ΠΉΠΊΠ°ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½Π° If c.Value = 25 Then ' Π΅ΡΠ»ΠΈ ΡΡΠ»ΠΎΠ²ΠΈΠ΅ Π²ΡΠΏΠΎΠ»Π½ΡΠ΅ΡΡΡ If r2 Is Nothing Then ' Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Π΅ΡΠ΅ ΠΏΡΡΡΠΎΠΉ Set r2 = c ' ΡΠΎΡΠΌΠΈΡΡΠ΅ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Else Set r2 = Union(r2, c) ' ΠΏΠΎΠΏΠΎΠ»Π½ΡΠ΅ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ End If End If Next c If Not r2 Is Nothing Then r2.Interior.Color = 255 ' Π·Π°Π»ΠΈΠ²Π°Π΅ΠΌ Set r1 = Nothing: Set r2 = Nothing ' ΠΎΡΠ²ΠΎΠ±ΠΎΠΆΠ΄Π°Π΅ΠΌ ΠΏΠ°ΠΌΡΡΡ End Sub
Fill lines by condition in the cell:
For i = 1 To r1.Rows.Count ' ΡΠΈΠΊΠ» ΠΏΠΎ ΡΡΡΠΎΠΊΠ°ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½Π° If r1(i, 1).Value = 25 Then ' Π΅ΡΠ»ΠΈ Π»Π΅Π²Π°Ρ ΡΡΠ΅ΠΉΠΊΠ° Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½Π°... If r2 Is Nothing Then ' Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Π΅ΡΠ΅ ΠΏΡΡΡΠΎΠΉ Set r2 = Range(Cells(i, 1), Cells(i, 3)) ' ΡΠΎΡΠΌΠΈΡΡΠ΅ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ Else Set r2 = Union(r2, Range(Cells(i, 1), Cells(i, 3))) ' ΠΏΠΎΠΏΠΎΠ»Π½ΡΠ΅ΠΌ Π΄ΠΈΠ°ΠΏΠ°Π·ΠΎΠ½ End If End If Next i