+ Reply to Thread
Results 1 to 8 of 8

click - hide/unhide column

  1. #1
    Registered User
    Join Date
    09-30-2009
    Location
    kosice, slovakia
    MS-Off Ver
    Excel 2003
    Posts
    17

    click - hide/unhide column

    Hi,
    how can i hide/unhide columns by clicking on another one ? For example when i click on a1, b1 with its content appears, another click, it dissapears. Normaly only a1 a3 are shown.
    Something like dropdown menu.

    thank you

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,964

    Re: click - hide/unhide column

    Try pasting this code into the relevant pane (e.g. Sheet1) in the VBA editor (Alt F11).

    Please Login or Register  to view this content.
    Martin

    If my solution has saved you time and/or money, please consider sponsoring my run in the 2020 London Marathon in aid of Cancer Research UK.

    https://uk.virginmoneygiving.com/MartinRice

  3. #3
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: click - hide/unhide column

    Have you looked at Grouping?

    http://datanalaysistips.blogspot.com...group-and.html

  4. #4
    Registered User
    Join Date
    09-30-2009
    Location
    kosice, slovakia
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: click - hide/unhide column

    THx for answers, both would work, but i have another problem. The thing i wanted to have in those hiding/unhiding rows are pictures, and i don't know how to do this, pic is allways just floating on top, either the cells are hiden, resized or whatever.

    Any thoughts about this? The think i need is click - picture vissible between a1 and a2(or a3) click-hidden. I need to have "picture link" in every row and i want to dispplay them on click or double click as many as i want - so placing picture in comment wont work, cause only 1 will be vissible at a time.

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,964

    Re: click - hide/unhide column

    How about....


    Please Login or Register  to view this content.

  6. #6
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: click - hide/unhide column

    Go to the properties of the image and select the "Move and Size With Cells" option. This will hide the image when the row/column is hidden.

  7. #7
    Registered User
    Join Date
    09-30-2009
    Location
    kosice, slovakia
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: click - hide/unhide column

    Thank you mrice, working like charm. Now i need to add a slight modification to the formula, how can i modify it to get this result: every second row will be hiding when clicking on the row top of it. ( there will be hidden picture in hide/unhide rows - 2,4,6,8,10... by clicking on 1,3,5,7,9...

  8. #8
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,964

    Re: click - hide/unhide column

    Try this variation.

    Please Login or Register  to view this content.

+ 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