ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What macro command to turn off page refresh (https://www.excelbanter.com/excel-discussion-misc-queries/108037-what-macro-command-turn-off-page-refresh.html)

CurtB

What macro command to turn off page refresh
 
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.

Jim Thomlinson

What macro command to turn off page refresh
 
application.screenupdating = false
'Your code here
Application.screenupdating = true
--
HTH...

Jim Thomlinson


"CurtB" wrote:

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.


Alan

What macro command to turn off page refresh
 
You can sandwich your code like this,

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

Regards,
Alan.
"CurtB" wrote in message
...
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.




CurtB

What macro command to turn off page refresh
 
Thanks, Jim and Alan.

"Alan" wrote:

You can sandwich your code like this,

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

Regards,
Alan.
"CurtB" wrote in message
...
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.






All times are GMT +1. The time now is 08:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com