ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Flashing screen even with Application.ScreenUpdating = False (https://www.excelbanter.com/excel-programming/447623-flashing-screen-even-application-screenupdating-%3D-false.html)

Bobby[_4_]

Flashing screen even with Application.ScreenUpdating = False
 
I am trying to pivot and hide between 2 sheets and make it look professional.

Event with this code I get the flashing screen as soon as the sheet gets visible.
Is there an other option that I could use?

Application.ScreenUpdating = False

If Sheets("Selection").Visible = False Then Sheets("Selection").Visible = True
Sheets("Selection").Select

Thank's ahead.

Claus Busch

Flashing screen even with Application.ScreenUpdating = False
 
Hi Bobby,

Am Sat, 10 Nov 2012 09:31:55 -0800 (PST) schrieb Bobby:

Application.ScreenUpdating = False

If Sheets("Selection").Visible = False Then Sheets("Selection").Visible = True
Sheets("Selection").Select


try:
With Sheets("Selection")
If .Visible = False Then .Visible = True
Application.Goto .Range("A1")
End With


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Bobby[_4_]

Flashing screen even with Application.ScreenUpdating = False
 
On Saturday, November 10, 2012 12:31:55 PM UTC-5, Bobby wrote:
I am trying to pivot and hide between 2 sheets and make it look professional.



Event with this code I get the flashing screen as soon as the sheet gets visible.

Is there an other option that I could use?



Application.ScreenUpdating = False



If Sheets("Selection").Visible = False Then Sheets("Selection").Visible = True

Sheets("Selection").Select



Thank's ahead.


Hi Claus!

I did try your way but unfortunately I get the flashing gray bar still!

Claus Busch

Flashing screen even with Application.ScreenUpdating = False
 
Hi Bobby,

Am Sat, 10 Nov 2012 10:32:48 -0800 (PST) schrieb Bobby:

I did try your way but unfortunately I get the flashing gray bar still!


do you refresh the pivot table when you activate this sheet?


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

GS[_2_]

Flashing screen even with Application.ScreenUpdating = False
 
I like Claus' approach except for the If...Then. If you want the sheet
visible then just set that regardless of whether it's currently visible
or not. Testing ALWAYS requires more processing and so should be
avoided when not necessary so code performance is optimal...

With Sheets("Selection")
.Visible = xlSheetVisible: Application.GoTo .Range("A1")
End With 'Sheets("Selection")

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



GS[_2_]

Flashing screen even with Application.ScreenUpdating = False
 
The following statement is likely the culprit...

Application.GoTo .Range("A1")

If you just want the sheet visible and A1 the active cell then try...

With Sheets("Selection")
.Visible = xlSheetVisible: .Cells(1).Activate
End With 'Sheets("Selection")

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



Bobby[_4_]

Flashing screen even with Application.ScreenUpdating = False
 
On Saturday, November 10, 2012 3:44:24 PM UTC-5, GS wrote:
The following statement is likely the culprit...



Application.GoTo .Range("A1")



If you just want the sheet visible and A1 the active cell then try...



With Sheets("Selection")

.Visible = xlSheetVisible: .Cells(1).Activate

End With 'Sheets("Selection")



--

Garry



Free usenet access at http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


After trying I still get the flashing gray bar

GS[_2_]

Flashing screen even with Application.ScreenUpdating = False
 
Bobby formulated on Saturday :
On Saturday, November 10, 2012 3:44:24 PM UTC-5, GS wrote:
The following statement is likely the culprit...



Application.GoTo .Range("A1")



If you just want the sheet visible and A1 the active cell then try...



With Sheets("Selection")

.Visible = xlSheetVisible: .Cells(1).Activate

End With 'Sheets("Selection")



--

Garry



Free usenet access at http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


After trying I still get the flashing gray bar


What grey bar? Are you talking about the Taskbar, OR the sheet tab
strip?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



GS[_2_]

Flashing screen even with Application.ScreenUpdating = False
 
I just tested the following code and the only thing I viewed on my
screen was the sheet appearing with A1 selected *after* I dismissed the
MsgBox.

Sub ShowSheet()
Application.ScreenUpdating = False
With Sheets("Sheet2")
.Visible = xlSheetVisible: Application.Goto .Cells(1)
End With 'Sheets("Sheet2")
Application.ScreenUpdating = True
End Sub 'ShowSheet

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



Bobby[_4_]

Flashing screen even with Application.ScreenUpdating = False
 
On Saturday, November 10, 2012 5:39:20 PM UTC-5, GS wrote:
Bobby formulated on Saturday :

On Saturday, November 10, 2012 3:44:24 PM UTC-5, GS wrote:


The following statement is likely the culprit...








Application.GoTo .Range("A1")








If you just want the sheet visible and A1 the active cell then try...








With Sheets("Selection")




.Visible = xlSheetVisible: .Cells(1).Activate




End With 'Sheets("Selection")








--




Garry








Free usenet access at http://www.eternal-september.org




Classic VB Users Regroup!




comp.lang.basic.visual.misc




microsoft.public.vb.general.discussion




After trying I still get the flashing gray bar




What grey bar? Are you talking about the Taskbar, OR the sheet tab

strip?



--

Garry



Free usenet access at http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


Hi GS,
I am taking about the sheet tab strip.

GS[_2_]

Flashing screen even with Application.ScreenUpdating = False
 
Bobby presented the following explanation :
Hi GS,
I am taking about the sheet tab strip.


What you see there is what happens when your macro ends and
ScreenUpdating automatically turns back on. The 'flicker' you refer to
is the result of the tab strip 'refreshing' itself to include the newly
visible sheetname.

Perhaps if you post your *entire code* it will shed more light for us.
But there will always be visible evidence whenever anything in the
active window updates/refreshes. Of courses, how & when this occurs
depends on the order of execution of the code causing it to happen.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



GS[_2_]

Flashing screen even with Application.ScreenUpdating = False
 
Just want to add that indiscriminate use of turning ScreenUpdating OFF
in sub procedures called by other procedures will cause ScreenUpdating
to automatically turn back on when those procedures that turn it off
end. If this is the case then sounds to me like some good code
management practices need to be adopted here!<IMO

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com