+ Reply to Thread
Results 1 to 3 of 3

Macro to hide/unhide columns (WRONG FORUM, PLEASE IGNORE)

  1. #1
    Registered User
    Join Date
    03-03-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    8

    Macro to hide/unhide columns (WRONG FORUM, PLEASE IGNORE)

    I'm new to using Macros so I need some help with hiding and unhiding columns.

    Basically what I'm trying to do is have the user select years of sales to compare.

    If it's possible I would like the input the user enters on the INPUT tab in cells B3, B4 and B5 to unhide the appropriate column in the RAW DATA tab so that the chart compares the years selected.

    So if the user selects 2007, 2008 and 2009 on INPUT tab then only columns D, E and F would be visible on the RAW DATA tab.

    Thanks in advance for any help!
    Last edited by IcemanFTW; 03-08-2011 at 11:13 AM. Reason: I had 2 windows open and I posted this in the wrong forum

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to hide/unhide columns (WRONG FORUM, PLEASE IGNORE)

    1) Right-click the INPUTS sheet tab and select VIEW CODE
    2) Paste in this sheet-event macro into the VBA module that opens
    Please Login or Register  to view this content.
    3) Close the editor and save your workbook.

    That macro will change the visible columns on RAW DATA as you edit cells B3:B5 on the INPUTS sheet.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-03-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to hide/unhide columns (WRONG FORUM, PLEASE IGNORE)

    Thanks so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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