Results 1 to 7 of 7

Excel VBA How to hide or show columns

Threaded View

  1. #1
    Registered User
    Join Date
    03-22-2021
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    2

    Excel VBA How to hide or show columns

    Hi all,

    I have a specific question and hopefully one of you can provide me with the correct code - I can't write VBA on my own though and I haven't found the right code to tweak yet.

    Problem (see attached file): I have a table (C12:I18) and I want to show certain columns based on a choice in one cell (B2). The matrix (C4:I7) states whether a column should be visible or not. One (1) means it is visible and zero (0) means it should be hidden. When I chosse 'All' in B2 then all columns are shown. When I choose 'Employment' then columns E and F should hide.

    I need flexibility in terms of adding more columns to the table and certainly my choices will increase (so the matrix will increase).

    Hope someone can help with code.

    Thanks, David
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Show/HIde Columns using VBA
    By pdalal in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-13-2016, 04:03 PM
  2. Show / Hide columns
    By DBenson1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2014, 05:27 PM
  3. Excel 2008 : Hide/show columns
    By Didieeer in forum Excel General
    Replies: 1
    Last Post: 02-02-2012, 07:36 AM
  4. Hide columns before printing and show after
    By bagulhodoido in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-23-2011, 11:31 PM
  5. Hide Show columns
    By Glio in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2007, 06:10 AM
  6. how can hide and show columns using macro?
    By Hoshyar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-02-2005, 11:05 AM
  7. [SOLVED] Show/Hide Columns
    By StephanieH in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-24-2005, 10:05 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