rinneii
New Member
- Joined
- Mar 20, 2019
- Messages
- 18
I need to use the offset property to get color in another column. This is what I have so far:
Option Explicit
Dim FinalRow As Integer
Dim i As Integer
Sub Colorfruit()
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To FinalRow
If Cells(i, 1).Value = "Grapefruit" Then
With Cells(i, 1).Offset(, 1)
If .Value >= 8 Then
.Interior.ColorIndex = 35
End If
End With
End If
Next i
End Sub
My goal is to have only 1 With block. In total I have 3 columns A-C.
Any help would be very much appreciated!
Option Explicit
Dim FinalRow As Integer
Dim i As Integer
Sub Colorfruit()
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To FinalRow
If Cells(i, 1).Value = "Grapefruit" Then
With Cells(i, 1).Offset(, 1)
If .Value >= 8 Then
.Interior.ColorIndex = 35
End If
End With
End If
Next i
End Sub
My goal is to have only 1 With block. In total I have 3 columns A-C.
Any help would be very much appreciated!