I have the below code to apply formatting to every second selected row.
It works when i use
but i want to apply different formatting. i want every second row coloured in blue. I have tried the below but it doesnt work. any ideas?
It works when i use
Rich (BB code):
Rich (BB code):
Selection.Rows(Counter).Interior.Pattern = xlGray16
Rich (BB code):
Rich (BB code):
Sub ShadeEveryOtherRow()
Dim Counter As Integer
LastRowColumnX = Cells(Rows.Count, 1).End(xlUp).Row
Range("A15:P" & LastRowColumnX).Select
For Counter = 1 To Selection.Rows.Count
If Counter Mod 2 = 1 Then
Selection.Rows(Counter).Interior
.Pattern = Solid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent5
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End If
Next
End Sub