Hi,
I am making some code that applies a filter and I wish to delete every rows that does not equal TRUE.
Headers are in row 4.
Items when looking at filter include TRUE, FALSE, #NUM!. I just want to delete FALSE and #NUM! and keep all rows that have TRUE.
Any and all help is appreciated.
eNVy
I am making some code that applies a filter and I wish to delete every rows that does not equal TRUE.
Headers are in row 4.
Items when looking at filter include TRUE, FALSE, #NUM!. I just want to delete FALSE and #NUM! and keep all rows that have TRUE.
VBA Code:
Sub OneC_Auto()
Dim lRow As Long
Dim ws1, ws2 As Worksheet
Dim rng1, dups, DateTrue As Range
Dim r1 As Integer
Set ws1 = Worksheets("1c boxi")
Set ws2 = Worksheets("1c client services")
r = 0
lRow = Cells.Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Set rng1 = Range("AR4:AU" & lRow)
Set dups = Range("AT4:AT" & lRow)
Set DateTrue = Range("AU4:AU" & lRow)
ws1.Range("AR4").Formula = "=TEXTJOIN("","",TRUE,A4,AK4,AL4)"
ws1.Range("AS4").Formula = "=XLOOKUP(AK4,'PSR lookup'!A:A,'PSR lookup'!B:B,"""")"
'ws1.Range("AT4").Formula = "=COUNTIF(AR$4:AR4,AR4)"
ws1.Range("AU4").Formula = "=IF(AND(DATEDIF(P4,$AU$2,""M"")>=12,OR(Q4>$AV$2,Q4="""")),TRUE,FALSE)"
ws1.Range("AR4:AU4").AutoFill _
Destination:=rng1, Type:=xlFillDefault
rng1.Value = rng1.Value
With ActiveSheet
.AutoFilterMode = False
With Range("AU3:AU" & lRow)
.AutoFilter Field:=47, Criteria1:="<>TRUE"
On Error Resume Next
.Offsert(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
Any and all help is appreciated.
eNVy
Last edited: