my spreadsheet has data in Coluns A thru E and j Thru R
in F, G and H I have the RGB values and I want to colour column I
Usng the follwing code I am able to colour the cells but the macro throws a Run-Time error '13': type mismatch and hightlights .Interior.Color = RGB(.Offset(, -3).Value, .Offset(, -2).Value, .Offset(, -1).Value) when I debug
somtimes I have 100 lines other times I have 250
Sub ColorMe()
Dim LR As Long, i As Long
LR = Range("F" & Rows.Count).End(xlUp).Row
For i = 6 To LR
With Range("I" & i)
.Interior.Color = RGB(.Offset(, -3).Value, .Offset(, -2).Value, .Offset(, -1).Value)
End With
Next i
End Sub
Can you help?
in F, G and H I have the RGB values and I want to colour column I
Usng the follwing code I am able to colour the cells but the macro throws a Run-Time error '13': type mismatch and hightlights .Interior.Color = RGB(.Offset(, -3).Value, .Offset(, -2).Value, .Offset(, -1).Value) when I debug
somtimes I have 100 lines other times I have 250
Sub ColorMe()
Dim LR As Long, i As Long
LR = Range("F" & Rows.Count).End(xlUp).Row
For i = 6 To LR
With Range("I" & i)
.Interior.Color = RGB(.Offset(, -3).Value, .Offset(, -2).Value, .Offset(, -1).Value)
End With
Next i
End Sub
Can you help?