+ Reply to Thread
Results 1 to 3 of 3

Show/Hide a sepcific column based on a condition in a cell

  1. #1
    Registered User
    Join Date
    11-18-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    7

    Show/Hide a sepcific column based on a condition in a cell

    Hello everyone.
    I would appreciate if some one can write the VBA for the following

    If cell G5=TRUE then hide entire column I and show entire column H. If cell G5=FALSE then hide entire column H and show entire column I.
    VBA should get triggered each time the value of cell G5 changes.

    Thanks

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Show/Hide a sepcific column based on a condition in a cell

    in the code of Sheet with G5 cell (right click on the tab with sheet name and choose show code) such a procedure:
    Please Login or Register  to view this content.
    would do the work

  3. #3
    Registered User
    Join Date
    11-18-2013
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Show/Hide a sepcific column based on a condition in a cell

    Dear Kaper
    Thanks for a quick response. However the code is partially working only and it hides column H whether the value of G5 changes to FALSE or to TRUE and doesn't do anything to column I. I will mention my requirement again below:
    If G5=TRUE then Hide column I and unhide column H
    If G5=FALSE then Hide column H and unhide column I

+ 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. How to show Images in a Cell based on a condition?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-15-2014, 08:00 AM
  2. [SOLVED] Hide/show rows with 0 value in column D and E based on case selection
    By say0nara in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2013, 06:34 AM
  3. [SOLVED] Hide show column selected column based on value
    By ola7mat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-07-2012, 02:44 PM
  4. [SOLVED] Hide a row based on one cell's condition
    By Brian in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-19-2005, 08:06 AM
  5. [SOLVED] How do I hide a column based on a condition (option not available.
    By jgentillet in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-24-2005, 12:06 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