So I have a pivot table that is updated from SQL database everyday. I want to highlight the whole section that days >5, but since data is updated daily, conditional formatting does not work. I created a dynamic range (see below), now I need it to run a loop to find where column 29 (where the days are next to name) is greater then 5 I need everything below to be highlighted in red as my attachment shows. Any help or suggestions? I know this is pretty complex.
CODE:
Sub dynamicRange()
'Disable certain Excel featured whilst Macro is running
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Application.ScreenUpdating = False
'Declare variables
Dim startCell As Range, lasRow As Long, lastCol As Long, ws As Worksheet
'Set Objects
Set ws = Sheet4
Set startCell = Range("N30")
'Find last row and column of data
lastRow = ws.Cells(ws.Rows.Count, startCell.Column).End(xlUp).Row
lastCol = ws.Cells(startCell.Row, ws.Columns.Count).End(xlToLeft).Column
'Select dynamic ramge of data
ws.Range(startCell, ws.Cells(lastRow - 1, lastCol - 1)).Select
'Re-enable certain Excel features after macro has run
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
Application.ScreenUpdating = True
