+ Reply to Thread
Results 1 to 5 of 5

How to Hide/unhide columns based on a specific cell's value

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    31

    Question How to Hide/unhide columns based on a specific cell's value

    Hi all !

    I'm looking for codes which will hide/unhide a range of columns based on a specific cell's value. For example,

    if cell B9=1, then columns N, O & P should be hidden,
    if B9=2, then columns N should be visible but O & P should be hidden,
    if B9=3 then columns N & O should be visible but P should be hidden,
    if B9=4 then columns N, O & P should be visible.

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: How to Hide/unhide columns based on a specific cell's value

    The macro will execute according to the number inserted in B9 as requested

    To view the macro, click on the deleloper option and then on the view source
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: How to Hide/unhide columns based on a specific cell's value

    This thread has been duplicated here
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Registered User
    Join Date
    05-25-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    31

    Re: How to Hide/unhide columns based on a specific cell's value

    Quote Originally Posted by Trebor76 View Post
    This thread has been duplicated here
    Hi Trebor ! the queries in these two threads are different and not duplication at all.

  5. #5
    Registered User
    Join Date
    05-25-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    31

    Re: How to Hide/unhide columns based on a specific cell's value

    Quote Originally Posted by rcm View Post
    The macro will execute according to the number inserted in B9 as requested

    To view the macro, click on the deleloper option and then on the view source
    Thanks RCM !
    Iit works fine for B9=1 & B9=4 but if B9=2 then Columns O & P remain visible with N hidden and if B9=3 then only Column P remains visible with N & O hidden.

+ 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. hide and unhide columns based on cell value
    By darijokesar in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-29-2014, 03:51 AM
  2. [SOLVED] Hide/Unhide columns based on the value of the cell help!
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-11-2014, 09:03 PM
  3. To hide/unhide rows based on specific value in a cell.
    By @jerry in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2014, 11:56 AM
  4. [SOLVED] Hide/Unhide Columns based on Cell Value
    By dberg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-26-2013, 03:36 PM
  5. Hide/Unhide Columns Depending on a specific cell value
    By DaveM13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-19-2012, 06:01 PM
  6. Hide/Unhide columns based on value of a cell
    By redrackham in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2011, 09:14 AM
  7. Hide & Unhide columns based on a cell value
    By DaveNUFC in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2010, 09:40 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