RuthandAndy
New Member
- Joined
- Jul 18, 2011
- Messages
- 27
I am trying to cut the data resulting from AutoFilter and paste it into another worksheet. I can successfully copy data, but when I attempt cut, I end up cutting all data from the first worksheet and pasting it into the second worksheet. Here is the code that works for .copy, LastRow is a variable.
Range("A4", "Ap" & LastRow).Select
with Sheets("production status")
.AutoFilterMode = False
.Range("A3", "Ap" & LastRow).AutoFilter
.Range("A3", "Ap" & LastRow).AutoFilter Field:=1, Criteria1 ="Z"
end with
Selection.Copy
When I try to change the last line to Selection.Cut is when the filter seems to quit working and all the data gets cut.
Range("A4", "Ap" & LastRow).Select
with Sheets("production status")
.AutoFilterMode = False
.Range("A3", "Ap" & LastRow).AutoFilter
.Range("A3", "Ap" & LastRow).AutoFilter Field:=1, Criteria1 ="Z"
end with
Selection.Copy
When I try to change the last line to Selection.Cut is when the filter seems to quit working and all the data gets cut.