Michael Simpson
Board Regular
- Joined
- Jun 21, 2010
- Messages
- 232
I have the following code
What I then need to do is loop through the rows for level 2 and set a specific colour in a specific column depending on its value (ie, if the value in column K is >0 , set colour to green, otherwise set to red).
Can someone suggest a good/simple way to do this please ? (Ie, what I need is some way of looping through the rows on the sheet and looking for the totalled lines and then setting the colour thereafter)
Code:
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5, 6, 7, 8, 9, 10, 11), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
' Default is to show subtotals at a bank level
ActiveSheet.Outline.ShowLevels RowLevels:=2
What I then need to do is loop through the rows for level 2 and set a specific colour in a specific column depending on its value (ie, if the value in column K is >0 , set colour to green, otherwise set to red).
Can someone suggest a good/simple way to do this please ? (Ie, what I need is some way of looping through the rows on the sheet and looking for the totalled lines and then setting the colour thereafter)