Can anyone advise on how to speed up the following code (it is running through 9000 records of MS Excel and takes about 14 minutes)?
Dim Num as Range
For Each Num In ActiveSheet.Range("A1:A9000")
If Num.Value = "Thing1" Then
Num.EntireRow.Copy
Sheets(1).Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
ElseIf Num.Value = "Thing2" Then
Num.EntireRow.Copy
sheets(2).Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
'ElseIf... through 40 more "Things"; 8 more sheets!!!
I thought of select case but going down that road did not seem to add any value. Any help is greatly appreciated!
Best regards.


Reply With Quote