+ Reply to Thread
Results 1 to 11 of 11

hide/undie untire column based on a dyanmic cell

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    164

    hide/undie untire column based on a dyanmic cell

    Hi all,

    In one of my sheet "APS", I would like to hide the entire columns of AB to AH when the value in W104 = 0, unhide when =1. W104 is a dynamic cell wih a IF function.

    However, there is something wrong with my code...
    Appreciate if anyone can assist.

    Thank you!

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

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: hide/undie untire column based on a dyanmic cell

    Hi whats the problem with the code? It gives you an error?

    Maybe this will help

    Please Login or Register  to view this content.
    Thanks

  3. #3
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: hide/undie untire column based on a dyanmic cell

    Hi thanks for reply.

    The code is not working although the cell value changes....
    however, if i changed the value manually... it worked... that means it is not capturing the change by itself

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: hide/undie untire column based on a dyanmic cell

    Hello hcyeap,

    Worksheet events will not fire as the result of formula calculation.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: hide/undie untire column based on a dyanmic cell

    you are right Leith and the change event is been limited to only Range("W104")

    Awesome!
    Last edited by Leith Ross; 12-29-2013 at 11:23 PM. Reason: Names are written in proper case

  6. #6
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: hide/undie untire column based on a dyanmic cell

    Please Login or Register  to view this content.
    That means i have to change the code to this?
    It give with run time error 424

  7. #7
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: hide/undie untire column based on a dyanmic cell

    no to this

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: hide/undie untire column based on a dyanmic cell

    Thank you fredlo and Leith for your kind assistance.

  9. #9
    Registered User
    Join Date
    07-29-2013
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    50

    Re: hide/undie untire column based on a dyanmic cell

    Hello hcyeap,

    I am just trying to support you. I think I am late. Please find the attched spread sheet with the code you need. It works fine. Please customize the cells according your requirements.

    Regards,
    gm2612

    Column Hide.xls

  10. #10
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    164

    Re: hide/undie untire column based on a dyanmic cell

    hi gm2612,thank you for your reply.

    i don't really understand this line

    Please Login or Register  to view this content.
    meaning run the macro when value is greater than 1?
    can you kindly explain?

    thank you!

  11. #11
    Registered User
    Join Date
    07-29-2013
    Location
    India
    MS-Off Ver
    Excel 2002
    Posts
    50

    Re: hide/undie untire column based on a dyanmic cell

    Hi hcyeap,

    It is a mistake. This line is not required. It works even without the specific line.

    Your reply is appreciated.

    Regards,
    gm2612

+ 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. Trying to hide row and column based on cell value
    By deef73 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2013, 07:24 AM
  2. Macro to hide column based on cell value
    By kingharvest in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2012, 11:24 AM
  3. Need macro to hide column based on cell value
    By kduschel in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-27-2012, 12:26 AM
  4. Hide column based on the value of the 1st cell in it
    By raehippychick in forum Excel General
    Replies: 2
    Last Post: 06-28-2007, 08:04 AM
  5. Hide/Unhide column based on cell value
    By DRK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2005, 12:05 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