Speed, why does this take so long?

RET79

Well-known Member
Joined
Mar 19, 2002
Messages
526
Hi.

I have formulas from columns A to AX on this worksheet. I want to copy them from rows 2 to 52000. I have written a macro to do this, just an usual

Sub copyrows

Range("A2:AX2").copy Range("A3:AX52000")

End sub

but, this takes about 2 or 3 minutes.

Similarly, I have set up a delete row macro to reverse the above

sub deleterows()

Range("A3:A52000").clearcontents

End sub

but this takes a minute or so.

Any ways of speeding this up? It is particularly annoying since I have put these codes in the workbook open and workbookbeforesave place.

Thanks,

RET79
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Place this at the beginning of your procedure.

ActiveSheet.EnableCalculation = False
Application.ScreenUpdating = False
Application.EnableEvents = False

at the end:

Application.EnableEvents = True
Application.ScreenUpdating = True
ActiveSheet.EnableCalculation = True

Tom
This message was edited by TsTom on 2002-04-27 05:34
 
Upvote 0
TSTom,

Thanks for the tip.

So, is this the fastest it can be done now?

RET79
 
Upvote 0
You could try:

Range("A2:A52000").FillDown

Don't know if that is any faster or not?

Tom
 
Upvote 0
I won't know until I get back to the office on Monday <sigh>.

But, I will try something similar soon and let you know on the board what the results of my experiments will be!

Thanks again,

RET79
 
Upvote 0

Forum statistics

Threads
1,213,490
Messages
6,113,957
Members
448,535
Latest member
alrossman

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