I have a macro which I have written to color A3:E3 with an accent style as well as where "Grand total" is found + 4 columns after Grand total is found
The macro colors A3:E3 + E4 and does not color the rows where"Grand Total is found" + 4 columns after this for eg if Grand Total is in A64, then A64:D64 to be colored using accent style
it would be appreciated if someone could assist me
The macro colors A3:E3 + E4 and does not color the rows where"Grand Total is found" + 4 columns after this for eg if Grand Total is in A64, then A64:D64 to be colored using accent style
Code:
Sub Colour_GrandTotal()
Sheets("pivot table").Select
With Range("A3:E3")
.Style = "Accent5"
End With
Dim r As Range
Set r = Sheets("Pivot Table").Cells.Find(What:="*Grand Total*", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False)
If Not r Is Nothing Then r.Resize(, 4).Style = "Accent5"
Sheets("Pivot Table").Select
End Sub
it would be appreciated if someone could assist me