Question about screen flicker

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
I have an application that uses forms for input and worksheets as data tables. The code looks something like this:

Application.Screenupdating = False
Sheets("Sheet1").visible = True
Sheets("Sheet1").activate
' update some rows within sheet1...
..
..
Sheets("Sheet1").visible = False
Application.Screenupdating = True


There are a bunch of code similar to this with muliple sheets being selected for update throughout the application within the Application.Screenupdating. The problem is that I see the sheets flickering in the background while the form is running. I thought the Application.Screenupdating = false suppress this. Any advice?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,270
It probably does suppress it but maybe you have a lot of formulas or charts or pivot tables in your workbook that you are not divulging with your question that could be a contributing factor. Or maybe timer code. Or maybe you don't need to unhide or select the sheets to do whatever you are doing. You said "forms for inputs" and if that means a bunch of controls on a bunch of worksheets, that will slow things down. If you give moer detail about your situation it will help people reading this to get a handle on what you are working with.
 

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
i think it only runs in the current module, changing code subs automatically cancels it.

if your code looks at other pages, you can get worksheet activate events, which if you programme right you can use application.enableevents = false (with care)

one of my work files flickers on a timer, I decided it allowed users to see it was actually working, so some has a use
 

repairman615

Well-known Member
Joined
Dec 21, 2009
Messages
1,885
If you are calling other macros that do not contain the screen update-false, that could also be a cause.
 

dave8

Active Member
Joined
Jul 8, 2007
Messages
275

ADVERTISEMENT

I'm not using any charts or timers, but I do have formulas. What I'm saying is for all the areas in which the application is performing an update in a worksheet, I turned off the Screenupdating. My understanding is that if I have to write in a worksheet, that worksheet must be selected. Is that correct? Thus....

Application.Screenupdating = False
Sheets("Sheet1").Visible = True
Sheets("Sheet1").activate <------- do I need to do this?
Sheets("Sheet1").Range("A1").value = "Orange"
Sheets("Sheet1").Range("E2:E6").select
Selection.clear
Application.Screenupdating = True
 

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,270
Why don't you just do this without unhiding the sheet or selecting the ranges?

Application.ScreenUpdating = False
With Sheets("Sheet1")
.Range("A1").value = "Orange"
.Range("E2:E6").Clear
End With
Application.ScreenUpdating = True
 

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
Thank you. I didn't know that could be done. I'll change the statements and see if I notice any difference.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,579
Messages
5,770,967
Members
425,653
Latest member
UNSING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top