Macro to check the last 7 values against mean
Closed
Colin
-
Jun 28, 2011 at 08:49 AM
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - Jun 30, 2011 at 02:25 AM
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - Jun 30, 2011 at 02:25 AM
Related:
- Macro to check the last 7 values against mean
- Kmspico windows 7 - Download - Other
- Check soft - Download - Finance
- Minecraft java edition free download for pc windows 7 - Download - Sandbox
- How to check if someone is spying on my whatsapp - Guide
- How to check pc power consumption in windows 11 - Guide
1 response
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
Jun 30, 2011 at 02:25 AM
Jun 30, 2011 at 02:25 AM
here the code is:
Its color last seven value as yellow if less than mean and Green if greater than mean. and no formating if equal to mean. :)
Private Sub CondFormat() Dim lastrow, i As Long Dim Mean As Long lastrow = Range("A" & Rows.Count).End(xlUp).Row Mean = WorksheetFunction.Average(Range("A" & lastrow - 29, "A" & lastrow)) For i = lastrow - 6 To lastrow If Range("A" & i) < Mean Then Range("A" & i).Interior.ColorIndex = 6 Else Range("A" & i).Interior.ColorIndex = 10 End If Next i End Sub
Its color last seven value as yellow if less than mean and Green if greater than mean. and no formating if equal to mean. :)