+ Reply to Thread
Results 1 to 5 of 5

Create option for hide column

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    56

    Create option for hide column

    Dear All,

    I have the question as how can show column when I put some value.

    For Example

    If I put number 0 at cell B2, then Excel will shows both column Demand V2 and V1 every month.

    If I put number 1 at cell B2, then Excel will hide column Demand V2 every month.

    If I put number 2 at cell B2, then Excel will hide column Demand V1 every month.

    so I have attach file example for this case.



    Could you please suggest me how can solve this one?

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Create option for hide column

    How about?

    Please Login or Register  to view this content.
    Paste code in a Sheet module
    • Where to paste code
    • Highlight macro to copy >> Ctrl + C >> Open your workbook
    • Right click on sheet tab >> View Code >> opens the Visual Basic Editor (VBE)
    • Ctrl + R >> opens the Project Explorer (if not already open on left side of screen)
    • Paste code >> Ctrl + V (right side of screen)
    • Alt + Q >> exits VBE and returns to Excel
    • Now simply make a change in target cell
    Last edited by jeffreybrown; 08-17-2017 at 06:03 PM. Reason: Updated Link
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Create option for hide column

    Dear jefferybrown,

    Thank you for your suggestion, but i am not sure that i do something wrong. Because the column does not hide after i put value 1 or 2.

    you can see my attached file.
    Attached Files Attached Files

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Create option for hide column

    Because you need to put the macro in the sheet module, not a regular module.

    Take a look at the instructions in post #2 again and even at the link.

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Create option for hide column

    thank you jeffreybrown

+ 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 option buttons based on other option button
    By monfos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2016, 05:16 PM
  2. Create Macro if any cell under "QUANTITY" Column = 0, then Hide, Multiple Worksheets
    By Spodzemny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 04:15 PM
  3. Create Macro that will 'hide" rows that have no variables in column C
    By BAWILS in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-04-2013, 10:28 PM
  4. How to create a macro to hide specific rows where 1st column contains merged cells
    By ascottbag in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2011, 01:16 PM
  5. Hide/Unhide Option - Need to consider all options!
    By Turquoise_dax in forum Excel General
    Replies: 3
    Last Post: 06-15-2006, 04:17 PM
  6. How to create a view option (or hide/unhide preselected cells) (Repost from Misc)
    By Turquoise_dax in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2006, 03:50 PM
  7. 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