+ Reply to Thread
Results 1 to 7 of 7

need excel formula to hide or unhide columns based on drop down list.

  1. #1
    Forum Contributor
    Join Date
    06-12-2013
    Location
    india
    MS-Off Ver
    Office 365
    Posts
    163

    need excel formula to hide or unhide columns based on drop down list.

    Hi Team,

    Please help me in getting the excel formula to hide or unhide columns based on drop down list.

    I tried to do it using conditional formating but not sure what to use in formula section. Kinldy help

    For example:

    If I select TOM under B1 - it need to show only the columns E:G and L:N. Rest of the columns should hide.
    If I select Robert under B1 - it need to show only the columns C:F and M:N. Rest of the columns should hide.

    I can do a filter for rows. Kindly help me. Attached sample file for your reference.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: need excel formula to hide or unhide columns based on drop down list.

    Sadly, you cannot hide or unhide columns with Conditional Formatting.

    https://excelribbon.tips.net/T009730...ell_Value.html
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    06-12-2013
    Location
    india
    MS-Off Ver
    Office 365
    Posts
    163

    Re: need excel formula to hide or unhide columns based on drop down list.

    Thank you for your reply, however I dont want to use VBA or save my file as Macro file. Kindly help me on this, if conditional formating is not works is there any other formula that will work.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: need excel formula to hide or unhide columns based on drop down list.

    … is there any other formula that will work.
    No, AFAIK, you cannot hide columns, or rows, with a formula.

    What you describe as your requirement would need VBA.

    As it stands, I can see no relationship between the columns and the names so, even with VBA, it's not ideal.

  5. #5
    Forum Contributor
    Join Date
    06-12-2013
    Location
    india
    MS-Off Ver
    Office 365
    Posts
    163

    Re: need excel formula to hide or unhide columns based on drop down list.

    Thank you for checking, if no other options. Please help me on VBA code for my sample file.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: need excel formula to hide or unhide columns based on drop down list.

    Please Login or Register  to view this content.
    This code goes in Sheet1.

    Click "Developer"==>Visual basic==>Sheet1 copy/paste code
    Attached Files Attached Files
    Last edited by JohnTopley; 06-30-2021 at 10:56 AM.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: need excel formula to hide or unhide columns based on drop down list.

    I'd be inclined to do it this way:

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. [SOLVED] Hide/Unhide Columns based on Drop-down selection in different tab
    By RashmiD2930 in forum Excel General
    Replies: 18
    Last Post: 08-19-2020, 12:50 PM
  2. problem of hide/unhide columns based on drop down list
    By rachelhe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2019, 03:15 AM
  3. [SOLVED] Worksheet_Change event - hide/unhide columns based on multiple drop down list
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-08-2018, 10:17 AM
  4. Hide/Unhide Columns based on Drop-Down Selection
    By Khafez in forum Excel General
    Replies: 21
    Last Post: 09-14-2016, 12:13 PM
  5. Hide/Unhide cells based on drop-down list
    By Savvy25 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2014, 02:36 AM
  6. [SOLVED] Hide/Unhide columns in multiple worksheets based on item chosen in a drop down list.
    By Gattaca2014 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-27-2014, 01:31 PM
  7. Hide/unhide columns based on the drop down list value
    By vagif in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2012, 02:13 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