J
jfcby
Hello,
I'm working on a project that I tring to put a color in every other
cell background but my code is not working correct.
My data looks like this example:
Column1 Column2 column6 column7
aaa bbb ccc ccc
aaa bbb ccc ccc
aaa bbb ccc ddd
aaa bbb ccc ddd
Now I'm tring to put a cell background color Column1 & Column2 & Column
6 & Column7 Row2, skip to Row4, skip to row6. But my code below will
only skip the first row but then it will not skip rows it put color in
every row.
Sub CellColor()
Dim Cell As Object, r As Range
Set r = Range("A1:C1")
For Each Cell In Range("A:A")
Cell.Offset(2, 0).Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
Next
End Sub
Thank you for your help,
jfcby
I'm working on a project that I tring to put a color in every other
cell background but my code is not working correct.
My data looks like this example:
Column1 Column2 column6 column7
aaa bbb ccc ccc
aaa bbb ccc ccc
aaa bbb ccc ddd
aaa bbb ccc ddd
Now I'm tring to put a cell background color Column1 & Column2 & Column
6 & Column7 Row2, skip to Row4, skip to row6. But my code below will
only skip the first row but then it will not skip rows it put color in
every row.
Sub CellColor()
Dim Cell As Object, r As Range
Set r = Range("A1:C1")
For Each Cell In Range("A:A")
Cell.Offset(2, 0).Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
Next
End Sub
Thank you for your help,
jfcby