View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
A.W.J. Ales A.W.J. Ales is offline
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