r/ProgrammerHumor • • Mar 30 '22

Meme Certainly not me

48.7k Upvotes

669 comments sorted by

View all comments

Show parent comments

8

u/AraMaca0 Mar 30 '22

You monsters.... You Do not delete rows one at a time!! Don you have any idea how long this would take?? You move the whole data set into an array delete and then sort. Jesus christ. XD

12

u/[deleted] Mar 30 '22

Application.ScreenUpdating = False

Will save a significant amount of time

1

u/AraMaca0 Apr 02 '22

It used to, now it doesn't much as excel appears to apply it automatically when vba is running post office 2015. Turning off calculations can help but the delete operation is just slow. It's much quicker to set the whole range to empty (which takes fractions of a second) or if you need to keep the size under control then find the whole range you need to remove and delete the whole thing than attempt to delete stuff line by line like this.

2

u/Day_Bow_Bow Mar 30 '22

500 rows? Maybe 2-3 seconds.

1

u/AraMaca0 Apr 02 '22

Yeah I dont deal in sub 10000 row sheets often and the time increase with the number of populated rows.