Rafael Alvares Tubero
New Member
- Joined
- Mar 18, 2011
- Messages
- 45
Hello, everybody!
Guys, I was trying to write a code that would make a filter on some data, and then it would cut those data selected by the filter and paste in another sheet. But I would like that the code was able to just cut and paste only what was selected, and what is happening with my actual code is: it is cutting and pasting everything, not just what was selected... check part of the code out...
ActiveSheet.Range(Cells(1, 1), Cells(ult_lin, ult_col)).AutoFilter Field:=7, Criteria1:=">" & Date - 1, _
Operator:=xlAnd
Cells(2, 2).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Cut
Sheets("NDF_termo").Select
ult_lin = Cells(Rows.Count, 2).End(xlUp).Row
Cells(ult_lin + 1, 1).Select
ActiveSheet.Paste
can you guys help me, please???
thanks a lot!
Guys, I was trying to write a code that would make a filter on some data, and then it would cut those data selected by the filter and paste in another sheet. But I would like that the code was able to just cut and paste only what was selected, and what is happening with my actual code is: it is cutting and pasting everything, not just what was selected... check part of the code out...
ActiveSheet.Range(Cells(1, 1), Cells(ult_lin, ult_col)).AutoFilter Field:=7, Criteria1:=">" & Date - 1, _
Operator:=xlAnd
Cells(2, 2).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Cut
Sheets("NDF_termo").Select
ult_lin = Cells(Rows.Count, 2).End(xlUp).Row
Cells(ult_lin + 1, 1).Select
ActiveSheet.Paste
can you guys help me, please???
thanks a lot!