Hi all,
This is my 1st post here and I come in the hope one of you, Excel guru guys (or girl) can make sense of this!
I've got this rather ugly code running on Excel 2007 and there it can go through 60.000 rows in less than 2 minutes. Try it on Excel 2013 and bang, it takes FOREVER... to the point that it actually does not work at all.
I've narrowed down to the copy/paste element. If I comment that out the rest runs fine. I've tried replacing the combo " .Copy and .PasteSpecial" with a simple Row.Value = Row.Value and with that Excel runs out of memory
Any ideas? Any help would be greatly appreciated!
Best regards,
M.
This is my 1st post here and I come in the hope one of you, Excel guru guys (or girl) can make sense of this!
I've got this rather ugly code running on Excel 2007 and there it can go through 60.000 rows in less than 2 minutes. Try it on Excel 2013 and bang, it takes FOREVER... to the point that it actually does not work at all.
I've narrowed down to the copy/paste element. If I comment that out the rest runs fine. I've tried replacing the combo " .Copy and .PasteSpecial" with a simple Row.Value = Row.Value and with that Excel runs out of memory
Any ideas? Any help would be greatly appreciated!
Best regards,
M.
Code:
Do Until IsEmpty(Sheets("DATA_IN").Range("B" & j))
Sheets("DATA_IN").Range("B" & j).Select
If Sheets("DATA_IN").Range("B" & j).Value = 0 Then
If featheringTriggerUp > 0 Then
featheringTriggerUp = featheringTriggerUp - 1
Else
d = d + 1
ActiveCell.EntireRow.Copy
Sheets("DATA_OUT_1").Range("A" & d).PasteSpecial Paste:=xlValues
featheringTriggerUp = 0
samples = samples + 1
End If
ElseIf Sheets("DATA_IN").Range("B" & j) <> 0 And featheringTriggerUp = 0 Then
featheringTriggerUp = feathering
For i = 1 To feathering
Sheets("DATA_OUT_1").Rows(d).EntireRow.Delete
d = d - 1
samples = samples - 1
Next
End If
j = j + 1
pctCompl = pctCompl + increment
progress pctCompl
Loop