rodrigo_m_almeida
New Member
- Joined
- Jan 13, 2022
- Messages
- 42
- Office Version
- 2021
- Platform
- Windows
Good Morning,
I need to subtract 1 day for date that time is less than 02:59:59
Using "ActiveCell" in DateAdd, no subtract anything from the found cell
I'm trying to do this with autofilter because my sheet is too big...
I need to subtract 1 day for date that time is less than 02:59:59
VBA Code:
Public Sub BradPitt()
With ActiveSheet
.AutoFilterMode = False
With Range("D1", Range("D" & Rows.Count).End(xlUp))
.AutoFilter 1, "<02:59:59"
On Error Resume Next
.Columns(-2).Offset(1).SpecialCells(12).Value = DateAdd("d", -1, ActiveCell) ' PROBLEM <
End With
.AutoFilterMode = False
End With
End Sub
Using "ActiveCell" in DateAdd, no subtract anything from the found cell
I'm trying to do this with autofilter because my sheet is too big...
Last edited: