FindFormat

M

Mike

I don't know what else you have in your code, but one of
the main reasons a loop takes long to run is that
everytime you change what is in a cell, everything
dependant on that cell recalculates. So to speed up any
piece of program code, add this before the loop.
Application.Calculation=xlCalculationManual

Then once all is done,
Application.Calculation=xlCalculationAutomatic


Another thing that slows things down is the screen
updating. So one more thing to speed up operation:
Application.ScreenUpdating = False at the beginning of a
routine, and Application.ScreenUpdating = True at the end.

Use both of these and your code could execute 1000 times
faster.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top