What macro command to turn off page refresh

C

CurtB

I am using SheetActivate to run a macro to position the cursor in a specified
cell with the selected cell being in the top row, regardless of where the
cell may have been when the worksheet was last active. I'm doing it by
selecting a cell in the macro that is in a row further down in the worksheet
and in a column further to the right than will display when the cell I want
is selected. I then select the desired cell and the cursor is positioned as
I want it. Everything works just fine. But, are there Excel commands that
will turn off the page refresh and subsequently turn it back on to prevent
the screen flicker when the cursor is repositioned? Thanks.
 
J

Jim Thomlinson

application.screenupdating = false
'Your code here
Application.screenupdating = true
 
A

Alan

You can sandwich your code like this,

Application.ScreenUpdating = False
'Your code here
Application.ScreenUpdating = True

Regards,
Alan.
 
C

CurtB

Thanks, Jim and Alan.

Alan said:
You can sandwich your code like this,

Application.ScreenUpdating = False
'Your code here
Application.ScreenUpdating = True

Regards,
Alan.
 

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