+ Reply to Thread
Results 1 to 6 of 6

Hiding and unhiding column automaticaly when a cell value changes

  1. #1
    Registered User
    Join Date
    11-14-2006
    Posts
    2

    Exclamation Hiding and unhiding column automaticaly when a cell value changes

    Hello friends,

    This is my first post and I think this forum has really brilliant people cooperating.

    My inquirie is that I would like to create a macro in excel that can hide and unhide columns automatically when a cell value changes.

    ie. When A1=pizza hide column d and show column c
    When A1=burger hid column c and show column d

    I want to apply this macro to a file that contains a lot of columns for each type of information.

    I will appreciate any help I can get about this.

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    this code will do what you want (or similar). Just paste it on the appropriate excel sheet module. ie Alt F11, find the relevant sheet in the top left hand window, double click to select the sheet, then paste the code in the code window on the right hand side.

    Matt

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by titovalle
    Hello friends,

    This is my first post and I think this forum has really brilliant people cooperating.

    My inquirie is that I would like to create a macro in excel that can hide and unhide columns automatically when a cell value changes.

    ie. When A1=pizza hide column d and show column c
    When A1=burger hid column c and show column d

    I want to apply this macro to a file that contains a lot of columns for each type of information.

    I will appreciate any help I can get about this.
    Hi,

    In the worksheet tab, rightmouse and View Code, and paste this into that sheet
    Please Login or Register  to view this content.
    ---
    Si fractum non sit, noli id reficere.

  4. #4
    evilrtc
    Guest
    I found this thread and I need something for a sheet I'm working on that is very similar. What I need to do though is hide an entire row if one cell in that row contains a certain word.

    How would I modify the above code to do this?

  5. #5
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    192
    Assuming your one cell is A1 then you could use this.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by evilrtc
    I found this thread and I need something for a sheet I'm working on that is very similar. What I need to do though is hide an entire row if one cell in that row contains a certain word.

    How would I modify the above code to do this?
    Hi,

    Try
    Please Login or Register  to view this content.
    will work for the A cell of the row, but I'm not sure how that fits into a thread for columns.

    Do you need the code to test any other cells? - is the 'word' the only content of the cell? - you need to confirm what is required.

    hth
    ---

+ 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