VBA: Change conditionally highlighted rows from current date to 24 hours
I inherited an Excel 2010 workbook that is utilized to import in another excel data feed that is extracted from online source daily. Once imported this .xlsm workbook does several things, custom columns, several sorts, conditional formatting, etc. It currently highlights all rows that have a CreatedDate of the current date. I need to modify this to evaluated the CreatedDate and highlight all rows in the last 24 hours as opposed to just the current date. I am struggling to find where I need to modify this code which is listed below. Additionally, to address a sorting problem, the initial creator of this strips the time of the CreateDate field upon import. The code below refers to the specific section of the macro that performs the highlighting of rows.. There is additional code that you may want to see I wanted to try to keep it simple...
Code:
highlightFields
moveRegulatory
Worksheets("Proposals").Select
tDate = False
For count = 1 To finalrow
If Range("AU" & count).Value = Date Then tDate = True
If tDate = True And Range("AU" & count).Value <> Date Then
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=Cells(count, 1)
tDate = False
End If
Next
End If
Dim reghear As String
For x = 1 To finalcol
Select Case Trim(Cells(2, x).Text)
Case "Regulatory Hearing Date"
reghear = MyColumnLetter(x * 1)
Exit For
End Select
Next
Columns("AX:AZ").Cut
Columns("AL:AL").Insert shift:=xlToRight
Columns(reghear).Cut
Columns("E:E").Insert shift:=xlToRight
Columns("J:J").Cut
Columns("E:E").Insert shift:=xlToRight
Columns("Y:Y").Cut
Columns("G:G").Insert shift:=xlToRight
For x = 1 To finalcol
Select Case Trim(Cells(2, x).Text)
Case "Regulatory Hearing Date"
reghear = MyColumnLetter(x * 1)
Columns(reghear).Hidden = True
Exit For
End Select
Next
Range("A3").Select
ActiveWindow.FreezePanes = True
Set fldialog = Nothing
Set dict = Nothing
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub