Results 1 to 3 of 3

Buttons to Hide/Unhide Columns - Speed Up?

Threaded View

  1. #1
    Registered User
    Join Date
    06-30-2008
    Location
    Georgia
    MS-Off Ver
    2013
    Posts
    72

    Question Buttons to Hide/Unhide Columns - Speed Up?

    I have a worksheet with some buttons to Hide and Unhide various columns. Everything in my current sheet works fine, but I was trying to find out if there is a way to speed it up some (there is currently a slight delay (not a major problem).

    Example of 3 button codes:
    Private Sub CommandButton1_Click()
    'This is for 1-3 Vendors
        Application.ScreenUpdating = False
        ActiveSheet.Unprotect Password:="test"
        Range("O:AP,AR:XFD").EntireColumn.Hidden = True
        ActiveSheet.Protect Password:="test", DrawingObjects:=True, _
        Contents:=True, Scenarios:=True
        Application.ScreenUpdating = True
    End Sub
    
    Private Sub CommandButton2_Click()
    'This is for 4 Vendors
        Application.ScreenUpdating = False
        ActiveSheet.Unprotect Password:="test"
        Range("A:R").EntireColumn.Hidden = False
        Range("S:AP,AR:XFD").EntireColumn.Hidden = True
        ActiveSheet.Protect Password:="test", DrawingObjects:=True, _
        Contents:=True, Scenarios:=True
        Application.ScreenUpdating = True
    End Sub
    
    Private Sub CommandButton3_Click()
    'This is for 5 Vendors
        Application.ScreenUpdating = False
        ActiveSheet.Unprotect Password:="test"
        Range("A:V").EntireColumn.Hidden = False
        Range("W:AP,AR:XFD").EntireColumn.Hidden = True
        ActiveSheet.Protect Password:="test", DrawingObjects:=True, _
        Contents:=True, Scenarios:=True
        Application.ScreenUpdating = True
    End Sub
    Thanks.
    Last edited by maddog9486; 11-25-2013 at 10:02 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Hide/Unhide Command Buttons along with Columns
    By EddieN1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2013, 09:53 AM
  2. VBA buttons for hide/unhide rows disappear at random
    By derekopswat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2013, 01:10 PM
  3. [SOLVED] Buttons need to hide/unhide along with columns
    By rowlandjp in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-28-2012, 03:29 PM
  4. Displaced control buttons after hide unhide
    By reinkonemann in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-11-2011, 10:36 AM
  5. I am missing something (hide / unhide rows with buttons)
    By Turquoise_dax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2006, 01:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1