Delta Star
Board Regular
- Joined
- Oct 28, 2009
- Messages
- 184
I don't know why but this piece of code has stopped working correctly. Once it has set the filter and selected those with 0, it not only clears those cells with a 0 but all the others as well.
What have I done wrong?
Range("A1:F1").Select
Range("F1").Activate
Application.CutCopyMode = False
Selection.AutoFilter
Range("A2:F" & LastRowA + 1).Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:F" & LastRowA + 1).Select
Range("F2").Activate
Selection.AutoFilter Field:=5, Criteria1:=0
Selection.ClearContents
Selection.AutoFilter
What have I done wrong?
Range("A1:F1").Select
Range("F1").Activate
Application.CutCopyMode = False
Selection.AutoFilter
Range("A2:F" & LastRowA + 1).Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:F" & LastRowA + 1).Select
Range("F2").Activate
Selection.AutoFilter Field:=5, Criteria1:=0
Selection.ClearContents
Selection.AutoFilter