Hi Zack,
its a lot faster but I am getting in an error also.
It tells me "no cell found".
Then I change from "Range(filterRng.Cells(2, 1)" to "Range(filterRng.Cells(1, 1)" and no error but nothing happens too
After that I tried to change from "filterRng.AutoFilter field:=2" to "filterRng.AutoFilter field:=1". It tells me the copy method from range class failed.
But the copy worked just fine, simply didnt delete the cells after copy.
I am pasting my plan and my code here for you to see.
Paleo2.xls |
---|
|
---|
| A | B | C | D |
---|
1 | Type | Order | Item | Value |
---|
2 | OP | 14642 | 051747S1 | 390 |
---|
3 | OP | 14642 | 051748S1 | 390 |
---|
4 | OP | 14085 | 1863393M93 | 8476,91 |
---|
5 | OP | 111301 | MIE400MEXE01 | 225 |
---|
6 | OP | 111301 | CPE275ADVE01 | 1254 |
---|
7 | OP | 111301 | CPE283ADVE01 | 842,4 |
---|
8 | OP | 111301 | CPE292ADVE01 | 416 |
---|
9 | OP | 111301 | CPE299ADVE01 | 607,2 |
---|
10 | OP | 111301 | MII400BE01 | 2071,3 |
---|
11 | OP | 111301 | MII5300E01 | 730,4 |
---|
12 | OP | 111301 | MOI5300E01 | 172 |
---|
13 | NC | 14129 | | 3456,51 |
---|
14 | OP | 64485 | 01107245/000 | 92,94 |
---|
15 | OP | 64485 | 01112916/000 | 222 |
---|
16 | OP | 64485 | 01112916/000 | 148 |
---|
17 | OP | 64485 | 01112916/000 | 148 |
---|
18 | NC | 14129 | 01119241/000 | 108,36 |
---|
|
---|
<font face=Courier New> Range("A1").EntireRow.Copy Sheets(Nova).Range("A1")
<SPAN style="color:#007F00">' Filter NC</SPAN>
<SPAN style="color:#00007F">Dim</SPAN> filterRng<SPAN style="color:#00007F">As</SPAN> Range, copyRng<SPAN style="color:#00007F">As</SPAN> Range
<SPAN style="color:#00007F">Set</SPAN> filterRng = Range("A1", Range("K65536").End(xlUp))
filterRng.AutoFilter field:=1, Criteria1:="=NC"
filterRng.SpecialCells(xlCellTypeVisible).Copy Sheets(Nova).Range("A1")
Range(filterRng.Cells(1, 1), filterRng.Cells(filterRng.Rows.Count, _
filterRng.Columns.Count)).SpecialCells(xlCellTypeVisible).Delete
filterRng.AutoFilter
Application.CutCopyMode =<SPAN style="color:#00007F">False</SPAN>
Sheets(Nova).Activate
Range("A1:F21").Select</FONT>