Hi All,
I'm having an issue with some vba coding, I basically want it to highlight the cells in column p where the (current date - 3 days) rule applies.
I am currently getting the whole row that highlights rather than the singular cell in column p.
Code is shown below:-
Sub HighlightDates()
Dim lngLastRow As Long, lngRow As Long
Dim Col As Long
Dim strColumn As String
strColumn = "P"
With ActiveSheet
lngLastRow = .Cells(.Rows.Count, strColumn).End(xlUp).Row
For lngRow = 2 To lngLastRow
If IsDate(.Cells(lngRow, strColumn).Value) And (.Cells(lngRow, strColumn).Value) >= Date - 3 Then
.Rows(lngRow).Interior.ColorIndex = 3
End If
Next lngRow
End With
End Sub
I would appreciate any help with this,
Thanks!
I'm having an issue with some vba coding, I basically want it to highlight the cells in column p where the (current date - 3 days) rule applies.
I am currently getting the whole row that highlights rather than the singular cell in column p.
Code is shown below:-
Sub HighlightDates()
Dim lngLastRow As Long, lngRow As Long
Dim Col As Long
Dim strColumn As String
strColumn = "P"
With ActiveSheet
lngLastRow = .Cells(.Rows.Count, strColumn).End(xlUp).Row
For lngRow = 2 To lngLastRow
If IsDate(.Cells(lngRow, strColumn).Value) And (.Cells(lngRow, strColumn).Value) >= Date - 3 Then
.Rows(lngRow).Interior.ColorIndex = 3
End If
Next lngRow
End With
End Sub
I would appreciate any help with this,
Thanks!