Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default blank display while macro runs

Randy, I took the code snippet you posted and "cleaned" it up to eliminate
the selects and activates.

Set Wks1 = Worksheets("W. Columbus Ave")
Wks1.Range("A6:A17").ClearContents
Set Wks2 = Worksheets("N. Genoa Ct")
WKs2.Range("A6:A11").ClearContents
Set Wks3 = Worksheets("N. Ferdinand Ct")
Wks3.Range("A6:A12").ClearContents

Using this style of code writing allows the code to execute without the
flicker and flash effect. The only thing is that you have to remember to
qualify all of your range objects with the sheet reference so it know where
to execute. Otherwise it assumes you want the active sheet to be the target.
You should practice up on this style if you will be doing a lot of code
writing, especially if you should decide to write a long program involving
more than one workbook and more than one sheet.
There are other little gimmicks that stop the flickering, like setting
calculation to manual. But the main thing is to get away from the select and
activate as much as possible. Sometimes, I still find it convenient to use
the activate method, but selection is no longer in my code.

"RandyPerry" wrote:

After getting the screenupdating=false/true where they needed to be, it
works! Thanks JLGWhiz,
Randy


"JLGWhiz" wrote:

Application.ScreenUpdating = False will help but if you have a lot of select
and activate in your code, it probably won't completely eliminate it. Also
don't forget to use Application.ScreenUpdating = True at the end of your
program.

"RandyPerry" wrote:

I run a macro in Excel that starts on tab 1, then goes to tab 2,3,4,5,etc.
and when it is finished, it returns to tab 1. When the macro runs, each of
the screens (tabs) flash by as the macro works on that tabs data and then
returns back to the beginning (tab 1). How can I keep the screen (tab 1)
active as the macro goes to each tab since it will end up at tab 1 at the end
of the macro?

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
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs Rruffpaw Setting up and Configuration of Excel 1 September 17th 11 01:25 PM
Can macro display a diff't screen while it runs until it stops? KT Excel Programming 2 January 5th 06 08:49 PM
Keep display steady while macro runs Salman[_2_] Excel Programming 3 November 6th 03 04:30 AM
Display a message whilst a macro runs steve Excel Programming 0 October 29th 03 07:37 PM
Display a message whilst a macro runs Tom Ogilvy Excel Programming 0 October 29th 03 12:43 PM


All times are GMT +1. The time now is 09:59 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"