Disabling an AutoRefresh of Scrolling in VBA

  • Thread starter Thread starter Devin
  • Start date Start date
D

Devin

Here is my problem:

I have a spreadsheet that has 40,000 + records in it. I
have written a macro that goes through and checks each
line to see if it matches some criteria. What happens, is
while this is occur, the screen keeps scrolling with each
line as it is selected, thus resulting in what looks like
the computer is freaking out. What I need is a way to
disable the scrolling of the sheet until the program has
finished running. Also, I use multiple sheets in the
workbook, so I guess I would have to disable it for the
whoel workbook. Any ideas?

Thanks
Devin
 
Devin,

Turn off screen updating so that your code executes
behind the scenes, then turn it back on at the end of
your code. This will also make the code run faster as
well.

Like:

Sub My_sub()
Application.ScreenUpdating = False
'your code
Application.ScreenUpdating = True
End Sub
 

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

Back
Top