Link to home
Start Free TrialLog in
Avatar of Michael Keith
Michael KeithFlag for United States of America

asked on

Why Application.ScreenUpdating code not working

I have the following code in an excel worksheet

Private Sub Show_Hide_Subtotal_Click()
  Application.ScreenUpdating = False
    If Show_Hide_Subtotal.Caption = "Hide Sub-total" Then
        Sheets("Projections").Select
        ActiveSheet.Range("J:J").EntireColumn.Hidden = True
        Show_Hide_Subtotal.Caption = "Show Sub-total"
    Else
       
        Sheets("Projections").Select
        ActiveSheet.Range("J:J").EntireColumn.Hidden = False
        Show_Hide_Subtotal.Caption = "Hide Sub-total"
    End If
    Application.ScreenUpdating = True
End Sub
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

I have the following code in an excel worksheet
and…?
Hi, Apex623.

Your code is working fine for me - please see attached.

In this example, turning off screen updating doesn't make any difference, so i presume that your real version must be doing other things. Please post all the code here.

Thanks,
Brian.ShowHide.xls
Avatar of Michael Keith

ASKER

Sorry I meant to say that the Application.Screenupdating is not working.    It shows the sheet being selected and I do not want that to happen.   I have posted the whole spreadsheet that I am working on.    The button that executes the code is on the "Proj. Assumptions" tab.   Thanks for the posts.
Client-Proforma.xlsm
ASKER CERTIFIED SOLUTION
Avatar of redmondb
redmondb
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help!
Thanks, Apex623!