+ Reply to Thread
Results 1 to 6 of 6

Automate Hiding Columns

  1. #1
    Registered User
    Join Date
    05-22-2017
    Location
    HASLETT
    MS-Off Ver
    Home and Student 2010
    Posts
    5

    Question Automate Hiding Columns

    I have a workbook with several columns that are not in use at this time. They all are labeled 'blank' in row 10.
    Is there a way to automate hiding any column that contains 'blank' in row 10?
    I appreciate any help.

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Automate Hiding Columns

    Hi rcnowland

    You can use this piece of Code to achieve what you are looking for.

    Let me know if you get stuck.

    Please Login or Register  to view this content.
    Please do add reputation where you see fit, it's nice to be nice and we all enjoy a pat on the back

    Please also mark your thread as solved once it has been.

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

    Re: Automate Hiding Columns

    Try this:

    Please Login or Register  to view this content.


    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    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

  4. #4
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Automate Hiding Columns

    I think the OP means that row 10 contains the word "Blank", not that it is blank.

  5. #5
    Registered User
    Join Date
    05-22-2017
    Location
    HASLETT
    MS-Off Ver
    Home and Student 2010
    Posts
    5

    Re: Automate Hiding Columns

    I added the work BLANK between the double quotes and it works great. Thanks so much.

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

    Re: Automate Hiding Columns

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Automate hiding columns, adding columns, inserting formulas, and filtering
    By hpatel517 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-27-2016, 11:17 AM
  2. [SOLVED] Hiding and un hiding columns using VBA code
    By Jes1397 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2015, 12:52 AM
  3. Hiding columns in excel without hiding form button
    By rename in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2013, 01:38 AM
  4. Replies: 9
    Last Post: 09-19-2012, 05:31 AM
  5. Un-Hiding and Hiding Columns based on Drop-Down Values in a Column.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 10-30-2011, 09:24 AM
  6. Un-Hiding and Hiding Columns based on Drop-Down Values in a Column.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2011, 06:49 AM
  7. Replies: 2
    Last Post: 10-18-2005, 10:05 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