Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Screen off during Macro execution

Hi All......

With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon the
macro jumps back and forth between screens and this causes each one to flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Screen off during Macro execution

CRoberts,

To stop updating of the screen :
Application.Screenupdating = False

To start it again :
Application.Screenupdating = True

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Screen off during Macro execution

Vaya, use this to cut off screen updating
Application.ScreenUpdating = False
'your code here
Application.ScreenUpdating = True


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Screen off during Macro execution

You could put the please wait in the status bar like this, or to put a
message on the screen have a look at "please_wait.zip" here
http://www.xl-logic.com/pages/vba.html

Application.ScreenUpdating = False
Application.StatusBar = "File Updating, Please Wait....!"
'your code here
Application.StatusBar = ""
Application.ScreenUpdating = True


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Paul B" wrote in message
...
Vaya, use this to cut off screen updating
Application.ScreenUpdating = False
'your code here
Application.ScreenUpdating = True


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro

that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any

way
to "turn off the display at the beginning of the macro and turn it back

on
again at the end"......??......or better yet, to put up some "Please

wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Screen off during Macro execution

Chuck,

I don't think the jumping back and forth between screens problem
can be fixed if you're activating or selecting them within your macro.
Application.ScreenUpdating = False seems to reset when you
switch worksheets.
You already knew all that though.

What I like to do is an idea that I got from Tom Ogilvy.
Create a UserForm and if you want, maximize it to fill the screen.
Run all of your macro code from within the Activate event of the
UserForm.

Private Sub UserForm_Activate()
DoEvents
' your code here
Unload UserForm1
End Sub

If you're feeling brave, you could use Application.Visible
to shut off the background altogether while the UserForm
is displayed (just pray that you don't encounter an error
between the Application.Visible = False and True statements)

John



"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Screen off during Macro execution

John,

Is that so ? I've never noticed that. I'm (now) using XP and have tested
the following testprogrogram in which I select several sheets.
I do however not see any flickering of sheets. Maybe this is solved in XP
?
(I will try it on a '97 version on monday, but I'm curious wether you know
more of it)


I've tested with this and with several smaller values of Atst

Sub AA()
Atst = 22500000
Application.ScreenUpdating = False
Sheets(2).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(3).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(1).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Application.ScreenUpdating = False
End Sub

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"John Wilson" wrote in message
...
Chuck,

I don't think the jumping back and forth between screens problem
can be fixed if you're activating or selecting them within your macro.
Application.ScreenUpdating = False seems to reset when you
switch worksheets.
You already knew all that though.

What I like to do is an idea that I got from Tom Ogilvy.
Create a UserForm and if you want, maximize it to fill the screen.
Run all of your macro code from within the Activate event of the
UserForm.

Private Sub UserForm_Activate()
DoEvents
' your code here
Unload UserForm1
End Sub

If you're feeling brave, you could use Application.Visible
to shut off the background altogether while the UserForm
is displayed (just pray that you don't encounter an error
between the Application.Visible = False and True statements)

John



"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro

that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any

way
to "turn off the display at the beginning of the macro and turn it back

on
again at the end"......??......or better yet, to put up some "Please

wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Screen off during Macro execution

Auk Ales,

As to why screen updating doesn't always work, I'm
not exactly sure. I do know that it sometimes doesn't when
selecting different sheets and that many others (including me)
have run into this problem.
I tried your code in Excel 2000 and it didn't flicker at all???

As for Chuck's question, knowing that he's a regular contributor
to the ng's, I was sure he had already tried the ScreenUpdating
so I wanted to offer some other alternatives.

John

"A.W.J. Ales" wrote in message
...
John,

Is that so ? I've never noticed that. I'm (now) using XP and have

tested
the following testprogrogram in which I select several sheets.
I do however not see any flickering of sheets. Maybe this is solved in

XP
?
(I will try it on a '97 version on monday, but I'm curious wether you know
more of it)


I've tested with this and with several smaller values of Atst

Sub AA()
Atst = 22500000
Application.ScreenUpdating = False
Sheets(2).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(3).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(1).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Application.ScreenUpdating = False
End Sub

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"John Wilson" wrote in message
...
Chuck,

I don't think the jumping back and forth between screens problem
can be fixed if you're activating or selecting them within your macro.
Application.ScreenUpdating = False seems to reset when you
switch worksheets.
You already knew all that though.

What I like to do is an idea that I got from Tom Ogilvy.
Create a UserForm and if you want, maximize it to fill the screen.
Run all of your macro code from within the Activate event of the
UserForm.

Private Sub UserForm_Activate()
DoEvents
' your code here
Unload UserForm1
End Sub

If you're feeling brave, you could use Application.Visible
to shut off the background altogether while the UserForm
is displayed (just pray that you don't encounter an error
between the Application.Visible = False and True statements)

John



"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro

that
does what I want it to do. The only thing now is, during it's

executon
the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any

way
to "turn off the display at the beginning of the macro and turn it

back
on
again at the end"......??......or better yet, to put up some "Please

wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Screen off during Macro execution

John,

Thanks for your response. From this I get the impression that my code
(which indeed doesn't flicker at all on my computer) DID do that on yours.
Just for the sake of intrest i will (as i already said) try it on the
computer at the office (Windows NT ; Excel 97).
I assume I'm just lucky that I (up to now) have never run into this, but
it's always good to know about it (just in case I do at some time run in it
and then save me a lot of time fibding out what is going on).

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"John Wilson" wrote in message
...
Auk Ales,

As to why screen updating doesn't always work, I'm
not exactly sure. I do know that it sometimes doesn't when
selecting different sheets and that many others (including me)
have run into this problem.
I tried your code in Excel 2000 and it didn't flicker at all???

As for Chuck's question, knowing that he's a regular contributor
to the ng's, I was sure he had already tried the ScreenUpdating
so I wanted to offer some other alternatives.

John

"A.W.J. Ales" wrote in message
...
John,

Is that so ? I've never noticed that. I'm (now) using XP and have

tested
the following testprogrogram in which I select several sheets.
I do however not see any flickering of sheets. Maybe this is solved in

XP
?
(I will try it on a '97 version on monday, but I'm curious wether you

know
more of it)


I've tested with this and with several smaller values of Atst

Sub AA()
Atst = 22500000
Application.ScreenUpdating = False
Sheets(2).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(3).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(1).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Application.ScreenUpdating = False
End Sub

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"John Wilson" wrote in message
...
Chuck,

I don't think the jumping back and forth between screens problem
can be fixed if you're activating or selecting them within your macro.
Application.ScreenUpdating = False seems to reset when you
switch worksheets.
You already knew all that though.

What I like to do is an idea that I got from Tom Ogilvy.
Create a UserForm and if you want, maximize it to fill the screen.
Run all of your macro code from within the Activate event of the
UserForm.

Private Sub UserForm_Activate()
DoEvents
' your code here
Unload UserForm1
End Sub

If you're feeling brave, you could use Application.Visible
to shut off the background altogether while the UserForm
is displayed (just pray that you don't encounter an error
between the Application.Visible = False and True statements)

John



"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro

that
does what I want it to do. The only thing now is, during it's

executon
the
macro jumps back and forth between screens and this causes each one

to
flash
up on the monitor and I would prefer that they not do

that.........any
way
to "turn off the display at the beginning of the macro and turn it

back
on
again at the end"......??......or better yet, to put up some "Please

wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3











  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Screen off during Macro execution

Auk Ales,

DID do that on yours

No, it didn't flicker at all on mine (XL2000) and that surprised me
as I expected it to flicker.
I did some searching but can't find a definitive list of what turns
Application.ScreenUpdating back to True but it does happen.
It happens on some of the workbooks that I've created and
based on the fact that there are thousands of threads in Google
on the subject of it not working as expected there are obviously
other things that can set it back to True unexpectedly.
I do know that it's a little more volatile than some of the other
settings in Excel to prevent the application from locking up.
Example...when you set EnableEvents, it'll hold it's setting
regardless of whatever else happens. ScreenUpdating will revert
to True when your code completes or when control is passed back
to the workbook.

Anyway, you've piqued my interest in finding out more about it and
I intend to find out just what it is in my own workbooks that sets
it back to True when I don't want it to.

I'll post back if I find anything.

If anyone else can shed some light on what events, etc. can set
it back to True after it's already been set to False, please feel
free to chime in.

John




"A.W.J. Ales" wrote in message
...
John,

Thanks for your response. From this I get the impression that my code
(which indeed doesn't flicker at all on my computer) DID do that on yours.
Just for the sake of intrest i will (as i already said) try it on the
computer at the office (Windows NT ; Excel 97).
I assume I'm just lucky that I (up to now) have never run into this, but
it's always good to know about it (just in case I do at some time run in

it
and then save me a lot of time fibding out what is going on).

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"John Wilson" wrote in message
...
Auk Ales,

As to why screen updating doesn't always work, I'm
not exactly sure. I do know that it sometimes doesn't when
selecting different sheets and that many others (including me)
have run into this problem.
I tried your code in Excel 2000 and it didn't flicker at all???

As for Chuck's question, knowing that he's a regular contributor
to the ng's, I was sure he had already tried the ScreenUpdating
so I wanted to offer some other alternatives.

John

"A.W.J. Ales" wrote in message
...
John,

Is that so ? I've never noticed that. I'm (now) using XP and have

tested
the following testprogrogram in which I select several sheets.
I do however not see any flickering of sheets. Maybe this is solved

in
XP
?
(I will try it on a '97 version on monday, but I'm curious wether you

know
more of it)


I've tested with this and with several smaller values of Atst

Sub AA()
Atst = 22500000
Application.ScreenUpdating = False
Sheets(2).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(3).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Sheets(1).Select
B = 0
For I = 1 To Atst
B = B + I
Next
Application.ScreenUpdating = False
End Sub

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"John Wilson" wrote in message
...
Chuck,

I don't think the jumping back and forth between screens problem
can be fixed if you're activating or selecting them within your

macro.
Application.ScreenUpdating = False seems to reset when you
switch worksheets.
You already knew all that though.

What I like to do is an idea that I got from Tom Ogilvy.
Create a UserForm and if you want, maximize it to fill the screen.
Run all of your macro code from within the Activate event of the
UserForm.

Private Sub UserForm_Activate()
DoEvents
' your code here
Unload UserForm1
End Sub

If you're feeling brave, you could use Application.Visible
to shut off the background altogether while the UserForm
is displayed (just pray that you don't encounter an error
between the Application.Visible = False and True statements)

John



"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty

macro
that
does what I want it to do. The only thing now is, during it's

executon
the
macro jumps back and forth between screens and this causes each

one
to
flash
up on the monitor and I would prefer that they not do

that.........any
way
to "turn off the display at the beginning of the macro and turn it

back
on
again at the end"......??......or better yet, to put up some

"Please
wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3













  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Screen off during Macro execution

Hey Chuck,

Merry Christmas/Happy New Year...

You can use the following to calm the screen display:

Application.ScreenUpdating = False

then before exiting your sub use:

Application.ScreenUpdating = True

Be aware that showing a message box while ScreenUpdating is turned off may
confuse your users if they move/drag the message box.

Regards,
Jim Cone
San Francisco, CA
D582

"CLR" wrote in message
...
Hi All......
With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......
TIA
Vaya con Dios,
Chuck, CABGx3





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Screen off during Macro execution

Application.ScreenUpdating = False

Nifty macro code

Application.ScreenUpdating = True

However, it would be better to design your code so it doesn't do selecting
and activating so you would not have this problem.

--
Regards,
Tom Ogilvy

CLR wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3





  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Screen off during Macro execution

CLR wrote:

Hi All......

With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon the
macro jumps back and forth between screens and this causes each one to flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3




Yes. bracket your code with:

application.screenupdating = false
..
..
..
application.screenupdating = true

  #13   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Screen off during Macro execution

Many thanks to all who responded.

I guess that's what makes these newsgroups so wonderful, is that you can
ask a simple question, and get back several different approaches to the
problem. Then you can choose the one that is the easiest for you to
understand and implement. Indeed, Auk Ales first response worked just fine
for me in my Win98SE-XL2k situation. Thanks for the compliment John, but
I'm sorry to disappoint you. I was not familiar with it, as I'm just
getting in to this code stuff.
I'm still at the "editing recorded macros, and copying other peeps code"
stage. <g

I will later look in to the other comments and suggestions......they will
certainly help my learning process.

Merry Christmas to everyone........

Vaya con Dios,
Chuck, CABGx3






"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any way
to "turn off the display at the beginning of the macro and turn it back on
again at the end"......??......or better yet, to put up some "Please wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3





  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Screen off during Macro execution


"CLR" wrote in message
...
Many thanks to all who responded.

I guess that's what makes these newsgroups so wonderful, is that you can
ask a simple question, and get back several different approaches to the
problem. Then you can choose the one that is the easiest for you to
understand and implement. Indeed, Auk Ales first response worked just

fine
for me in my Win98SE-XL2k situation. Thanks for the compliment John, but
I'm sorry to disappoint you. I was not familiar with it, as I'm just
getting in to this code stuff.
I'm still at the "editing recorded macros, and copying other peeps code"
stage. <g

I will later look in to the other comments and suggestions......they will
certainly help my learning process.

Merry Christmas to everyone........

Vaya con Dios,
Chuck, CABGx3






"CLR" wrote in message
...
Hi All......

With you fine folks help, I've managed to put together a nifty macro

that
does what I want it to do. The only thing now is, during it's executon

the
macro jumps back and forth between screens and this causes each one to

flash
up on the monitor and I would prefer that they not do that.........any

way
to "turn off the display at the beginning of the macro and turn it back

on
again at the end"......??......or better yet, to put up some "Please

wait"
message during processing.......

TIA
Vaya con Dios,
Chuck, CABGx3







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I turn the screen off during macro execution redondo Excel Worksheet Functions 2 March 4th 10 11:24 PM
Macro Execution C Brandt Excel Discussion (Misc queries) 2 July 13th 07 07:23 AM
Restricting Macro Execution Bob Umlas[_3_] Excel Programming 2 December 3rd 03 04:29 PM
automatic macro execution Jos reulen Excel Programming 4 November 10th 03 03:10 PM
Hiding macro execution Angeliki Excel Programming 4 November 7th 03 01:35 PM


All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"