Hello,
Hope you are well.
I am trying to colour four contiguous cells to a certain colour using two variables in a for Next Loop using the Offset statement. The flaw in my code is it only colours three contiguously, but not the fourth.
My code:
<code>
For x = 0 To 1
Can someone please assist or give advice to colour the 4 contiguously?
Regards,
Herman
Hope you are well.
I am trying to colour four contiguous cells to a certain colour using two variables in a for Next Loop using the Offset statement. The flaw in my code is it only colours three contiguously, but not the fourth.
My code:
<code>
For x = 0 To 1
For y = 0 To 1
ActiveCell.Offset(x, y).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 6724095
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Next y
Next x
</code>
Can someone please assist or give advice to colour the 4 contiguously?
Regards,
Herman