Hello all
I keep getting an error on this code and I can't figure out why
"It's error 1004 Cannot use that command on overlapping selection"
The code filters on column "N" and only shows lines not equal to "C2" on sheet 5, this is working ok
But when it comes to delete the visible lines I get the error code
I keep getting an error on this code and I can't figure out why
"It's error 1004 Cannot use that command on overlapping selection"
The code filters on column "N" and only shows lines not equal to "C2" on sheet 5, this is working ok
But when it comes to delete the visible lines I get the error code
Code:
Sheets("Data").Select
Range("A1").Select
With Sheets("Data")
lr = .Range("N" & Rows.Count).End(xlUp).Row
If .AutoFilterMode Then .AutoFilterMode = False
Intersect(.UsedRange, .Range("N:N")).AutoFilter 1, "<>" & Sheet5.Range("C2").Value
[I][B] .Range("A2:AB" & lr).SpecialCells(xlVisible).EntireRow.Delete[/B][/I]
.AutoFilterMode = False
End With