• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Go to selected sheet on open still flashes last sheet from close?

Cammandk

Member
When the workbook opens I want it to go to the selected sheet which I am using as a splash screen based on a condition.
I've put this code in "This Workbook" to action when WB opens.
However it doesn't go cleanly to this screen. It still flashes up what I think was the last sheet when workbook closed last - and then it goes to the required sheet.
I've tried [Application.Screenupdating=False] but still not clean. Did I have it in the wrong place?
Or something else.

[Private Sub Workbook_Open()

Dim strCMActive As String
strCMActive = Sheet6.Range("W16")

If strCMActive = "YES" Then
Sheet79.Select

Else
Sheet78.Select

End If

End Sub]
 
Does this work?
Code:
Private Sub Workbook_Open()

Dim strCMActive As String
Application.ScreenUpdating = False
strCMActive = Sheet6.Range("W16")

If strCMActive = "YES" Then
    Sheet79.Select
Else
    Sheet78.Select
End If
Application.ScreenUpdating = True
End Sub
 
Hi Luke
Tried this already and it made no difference.
It is definitely showing the last screen when the workbook closed - feels like for almost a couple of seconds.
DK
 
Does your workbook have a lot of calculations that it's needing do? That might be slowing things down. An alternative work-around would be to try to catch it on the other side; use the Before_Save event, and have the desired worksheet get selected before saving. Then when you re-open the book, it would be in the right spot.
 
Hi, Cammandk!
If Luke M's guess isn't correct, would you describe your hardware specs and the file size? Hope you've yet moved from that old 386SX to a fully powered 486.
Regards!
 
Hi Luke, SirJB7

I think you are both right. Luke I've already gone your route and it's certainly better. The hardware maybe struggling as well - Vostro 3500 3gb ram. File is 5meg without data yet - about 60 sheets in.
I'll try on a faster machine.

Thanks
DK
 
Back
Top