kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Code:
Sub filterDate()
sh.[O2] = "=COUNTIF(E4:N4,TODAY())=0"
Application.ScreenUpdating = False
lr = sh.Range("B" & Rows.Count).End(xlUp).Row
If lr < 3 Then lr = 3
With sh.Range("B3:N" & lr)
.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=sh.[O1:O2], Unique:=False
.Offset(1).ClearContents '.EntireRow.Delete
If .Parent.FilterMode Then .Parent.ShowAllData
End With
Application.ScreenUpdating = True
End Sub
It's working fine but the issue I have is with my dates.
I enter dates as dd-mm-yy (textbox input) and send it to my Worksheet.
It has been working cool until I start to notice that some of the dates change after sending them to the sheet (which I think could be as a result of how the system date format is).
For example, when I enter 12-01-22, it enters the sheet as 01-12-22.
So I decided to format the date columns on the sheet as texts so that I store the dates as texts instead (which stay unchanged).
And doing so, prevented the above code from working as before.
How do I get it back online?
Thanks in advance.