Horrendous performance on Excel 2013, all good in Excel 2007

addario

New Member
Joined
Oct 23, 2014
Messages
1
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.


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
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
addario,

Welcome to the MrExcel forum.

1. What version of Excel and Windows are you using?

2. Are you using a PC or a Mac?


Try adding the following BOLD line of code (it clears out the memory buffer):

Code:
            ActiveCell.EntireRow.Copy
            Sheets("DATA_OUT_1").Range("A" & d).PasteSpecial Paste:=xlValues
            [B][SIZE=3]Application.CutCopyMode = False[/SIZE][/B]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,937
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top