+ Reply to Thread
Results 1 to 5 of 5

Hide multiple columns across all worksheets

  1. #1
    Registered User
    Join Date
    05-16-2020
    Location
    Alaska
    MS-Off Ver
    2016
    Posts
    7

    Hide multiple columns across all worksheets

    Thank you in advance for anyone who might have the time and energy to help me.

    I would like to include VBA coding to hide columns "H:H" and "O:P" on all worksheets in this workbook. I would like this to take place upon opening the workbook "Workbook_Open()", and the second is upon protecting all worksheets "Protect()".

    Couple things to note, I am using "UserInterfaceOnly:=True" and "EnableOutlining = True" as I still need the end users to be able to use the groupings (both rows and columns), but there are columns H:H and O:Q that have information I would like to stay hidden.

    I hope someone has time to help out!

    FYI - Password: netpar



    Workbook_Open: UserInterfaceOnly = True; Hide H:H and O:Q; Collapse all grouping to level 1



    Please Login or Register  to view this content.



    Module 1: Protect and hide columns :H: and O:Q



    Please Login or Register  to view this content.




    NOT NEARLY AS IMPORTANT

    There is Module 2 that unprotects all worksheets. I'd love it if it unhide all columns (then grouped to level 1). The issue I have experience with this is the end user can try to unlock without the password, which doesn't unprotect, but does open all hidden columns. I believe this is because of the UserInterface setting that is needed for the grouping.

    Thanks again (file attached this time)
    Attached Files Attached Files
    Last edited by loudengreiner; 05-22-2020 at 06:15 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: Hide multiple columns across all worksheets

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-16-2020
    Location
    Alaska
    MS-Off Ver
    2016
    Posts
    7

    Re: Hide multiple columns across all worksheets

    Thank you very much Alan, I will keep that in mind in future posts.

  4. #4
    Registered User
    Join Date
    05-16-2020
    Location
    Alaska
    MS-Off Ver
    2016
    Posts
    7

    Re: Hide multiple columns across all worksheets

    I didn't see anything in the rules about bumping a post, hoping it will get looked at some experts again

    I'm still fighting to figure out how to hide all these columns!

  5. #5
    Registered User
    Join Date
    05-16-2020
    Location
    Alaska
    MS-Off Ver
    2016
    Posts
    7

    Re: Hide multiple columns across all worksheets

    I was able to find the code, I have updated the coding below. Feel free to educate me if there are better ways of accomplishing these needs.

    I will say I am unable to add in coding to unhide all columns in the Unprotect macro because users without the password are able to run the macro, which will not unprotect all worksheets, but will unhide all columns (due to UserInterface = True), which defeats the entire purpose of this excercise.

    Upon opening workbook, enable outline, allow filtering, hid columns, and collapse all grouping
    Please Login or Register  to view this content.
    Hide columns, collapse all grouping, protect all worksheets
    Please Login or Register  to view this content.


    Unprotect all worksheets, collapse all grouping, NEED: Unhide all columns ONLY WITH PASSWORD
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Hide columns in multiple worksheets - each sheet has its own name
    By Tyso in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-29-2013, 01:53 PM
  2. [SOLVED] Hide columns in multiple worksheets
    By Tyso in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2013, 10:47 AM
  3. Macro to hide columns and change formulas in multiple worksheets
    By Catthy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2012, 10:26 PM
  4. [SOLVED] Hide empty columns that appear the same from multiple worksheets
    By tinhtu in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-22-2012, 01:16 PM
  5. Hide empty columns from multiple worksheets
    By tinhtu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-18-2012, 02:19 PM
  6. Checkbox to hide columns across multiple worksheets
    By BrakeJake in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2012, 09:49 PM
  7. Hide columns in multiple worksheets based on one cell.
    By -Johan- in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2011, 02:36 AM

Tags for this Thread

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