Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Screen Updating problem with nested subroutines

I have a problem with the screen updating not working when using nested
subroutines. i.e.

Sub main()

Application.ScreenUpdating = False
nestedSub
Application.ScreenUpdating = True

End Sub

Sub nestedSub()

Application.ScreenUpdating = False
Code here...
Application.ScreenUpdating = True

End Sub

If I run nestedSub, there is no screen flicker. However if I run main, there
is flickering the whole time (as it calls nestedSub)

How can I get it so that if I run main, it only updates the screen after
ending main, not after running nestedSub and main?

Thanks
Atreides
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Screen Updating problem with nested subroutines

Remove the screenupdating code from "nestedSub"
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Atreides" <atreides1AThotmailD0Tcom
wrote in message
I have a problem with the screen updating not working when using nested
subroutines. i.e.
Sub main()
Application.ScreenUpdating = False
nestedSub
Application.ScreenUpdating = True
End Sub

Sub nestedSub()
Application.ScreenUpdating = False
Code here...
Application.ScreenUpdating = True
End Sub

If I run nestedSub, there is no screen flicker. However if I run main, there
is flickering the whole time (as it calls nestedSub)
How can I get it so that if I run main, it only updates the screen after
ending main, not after running nestedSub and main?
Thanks
Atreides
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Screen Updating problem with nested subroutines

"Jim Cone" wrote:
Remove the screenupdating code from "nestedSub"


I should have stated that I want to also run nestedSub on it's own (i.e.
without calling main) and not have screen flicker. Currently, nestedSub
without that code creates screen flicker as it runs. That's why the
screenupdating code is in nestedSub.

(Sorry if my generic names are misleading)

Atreides
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Screen Updating problem with nested subroutines

Sub main()

Application.ScreenUpdating = False
nestedSub
Application.ScreenUpdating = True

End Sub

Sub nestedSub()
Dim bState as Boolean
bState = Application.ScreenUpdating
If bState then _
Application.ScreenUpdating = False
Code here...
if bState then _
Application.ScreenUpdating = True
End Sub

--
Regards,
Tom Ogilvy


"Atreides" <atreides1AThotmailD0Tcom wrote in message
...
"Jim Cone" wrote:
Remove the screenupdating code from "nestedSub"


I should have stated that I want to also run nestedSub on it's own (i.e.
without calling main) and not have screen flicker. Currently, nestedSub
without that code creates screen flicker as it runs. That's why the
screenupdating code is in nestedSub.

(Sorry if my generic names are misleading)

Atreides



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Screen Updating problem with nested subroutines

Thanks Tom, that works!

"Tom Ogilvy" wrote:

Sub main()

Application.ScreenUpdating = False
nestedSub
Application.ScreenUpdating = True

End Sub

Sub nestedSub()
Dim bState as Boolean
bState = Application.ScreenUpdating
If bState then _
Application.ScreenUpdating = False
Code here...
if bState then _
Application.ScreenUpdating = True
End Sub

--
Regards,
Tom Ogilvy


"Atreides" <atreides1AThotmailD0Tcom wrote in message
...
"Jim Cone" wrote:
Remove the screenupdating code from "nestedSub"


I should have stated that I want to also run nestedSub on it's own (i.e.
without calling main) and not have screen flicker. Currently, nestedSub
without that code creates screen flicker as it runs. That's why the
screenupdating code is in nestedSub.

(Sorry if my generic names are misleading)

Atreides




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
problem breaking macro into 2 subroutines [email protected] Excel Programming 2 March 23rd 06 07:05 PM
Screen Updating Raman325[_9_] Excel Programming 2 June 30th 05 08:45 PM
Screen updating Mark Stephens Charts and Charting in Excel 0 February 18th 05 03:55 PM
Screen updating Stratuser Excel Programming 0 April 16th 04 05:20 PM
Screen Updating Jase Excel Programming 1 October 23rd 03 05:05 PM


All times are GMT +1. The time now is 06:15 AM.

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

About Us

"It's about Microsoft Excel"