I've been using the following code pretty successfully in pre-2007 versions of Excel. But in 2007, it takes an hour to run, I think because Excel 2007 supports 1million rows, rather than 64K! I can change the "columns("I:I").Select to
Range("i1").Select
Range(Selection, Selection.End(xlDown)).Select
which speeds things up a bit, but it is still very slow. Any recommendations for changing the code to run faster?
TIA
Code:Sub ExtractRecords() ' ' Copies all records containing "chinatest" in column I to Data worksheet and pastes into China worksheet. Returns to Data worksheet and ' removes copied titles ' ' 'Selects Data worksheet Sheets("Data").Select ' Filters by URL containing "chinatest" Columns("I:I").Select Selection.AutoFilter Selection.AutoFilter field:=1, Criteria1:="=*chinatest*", Operator:= _ xlAnd 'Copies all visible cells and pastes into China worksheet Cells.Select Selection.Copy Sheets("china").Select Range("A1").Select ActiveSheet.Paste 'Returns to Data worksheet and deletes visible titles Sheets("Data").Select Range("A2").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select Application.CutCopyMode = False Selection.EntireRow.Delete Selection.AutoFilter End Sub




Reply With Quote