+ Reply to Thread
Results 1 to 5 of 5

Hide Columns

  1. #1
    Registered User
    Join Date
    07-04-2011
    Location
    London England
    MS-Off Ver
    Excel 2013
    Posts
    71

    Hide Columns

    Hello
    I'd like to hide columns from C to Z that do not contain the same word shown in cells A3, A4 or A5. I am familiar with providing the necessary button to run the code.
    can anyone give me any suggestions?
    Many thanks.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,657

    Re: Hide Columns

    Did you mean the column headers in row 1 don't contain the three values? If yes, then try something like this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 01-20-2015 at 09:29 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-04-2011
    Location
    London England
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Hide Columns

    Hello
    In column A, I have several cells, currently A3, A4 and A5 (and may have a few more) that could contain a word matching a cell or cells in columns C to Z. What I need is all columns from C to Z that do not contain a word matching any cell in Column A, to be hidden.
    Thanks again.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,657

    Re: Hide Columns

    Quote Originally Posted by Garysmith View Post
    Hello
    In column A, I have several cells, currently A3, A4 and A5 (and may have a few more) that could contain a word matching a cell or cells in columns C to Z. What I need is all columns from C to Z that do not contain a word matching any cell in Column A, to be hidden.
    Thanks again.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-04-2011
    Location
    London England
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Hide Columns

    Great
    I swapped the .Hidden = "true" and "false" around and it does exactly what I need.
    Thanks for your help.

+ 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. VBA code to hide filtered columns (simple table 5 rows / 6 columns wide)
    By e2010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2014, 02:41 PM
  2. Hide columns using Columns' number
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2014, 08:35 AM
  3. [SOLVED] Hide - Un Hide rows with empty columns
    By BDF in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-14-2014, 02:09 PM
  4. [SOLVED] Hide Columns based on level of access e.g. if "Read Only" Hide G:G
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2013, 06:10 AM

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