dj44
12-01-2017, 07:31 AM
good friday,
I am trying to highlight my cells.
if Column A contains the word "hello" color cells B,C,D,E
Private Sub Highlight_Range()
For Each oCell In ThisWorkbook.Worksheets("test").Range("A1:A100").Cells
' How may i color cells , C,D,E,F?
If oCell = "hello" Then oCell.Offset(, 1).Interior.ColorIndex = 3
Next
End Sub
Example
A5 contains "hello"
now
A5 ,B5,C5,D5,E5 should be red
I only managed to color B
I am trying to highlight my cells.
if Column A contains the word "hello" color cells B,C,D,E
Private Sub Highlight_Range()
For Each oCell In ThisWorkbook.Worksheets("test").Range("A1:A100").Cells
' How may i color cells , C,D,E,F?
If oCell = "hello" Then oCell.Offset(, 1).Interior.ColorIndex = 3
Next
End Sub
Example
A5 contains "hello"
now
A5 ,B5,C5,D5,E5 should be red
I only managed to color B