Cells(row, j).Interior.colorindex
There's nothing obviously wrong with your routine.
FWIW no need to loop, eg
With Cells(row, 1).Resize(1, 25)
or
With Range(Cells(row, 1), Cells(row, 25))
.Font.ColorIndex = 2
.Interior.ColorIndex = cindex
End With
and if not looping no need to disable screenupdating just for that
Small thing, these days better to use As Long rather than As Integer, not
that it'll make any difference in your routine.
Regards,
Peter T
"KT_1010" wrote in message
...
Sub setHighlight(row As Long, cindex As Integer)
Dim ix As Long
Application.ScreenUpdating = False
For ix = 1 To 25
With Cells(row, ix)
.Font.ColorIndex = 2
.Interior.ColorIndex = cindex
End With
Next ix
Application.ScreenUpdating = True
End Sub
and call setHighlight(ActiveCell.Row, 23) ' 23 is one of the 56
possilble indexs to Colors
|