+ Reply to Thread
Results 1 to 4 of 4

Hide columns based on autofilter selection

  1. #1
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Angry Hide columns based on autofilter selection

    Hi All,

    I'm trying to work out a way how to hide cols dependent on autofilter selection but have come to a point in scratching my head.

    So far I have this:

    Please Login or Register  to view this content.
    With a =now() in another cell to trigger the calculation when autofiltering

    But it seems to get caught in a never ending loop and can't work out a way forward.

    If anyone can help me or suggest an alternative way to code it to hide cols based on autofilters i'd be most greatful

  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: Hide columns based on autofilter selection

    Try turning other macros off at the top of this macro so it can proceed to the end without triggering anything else, then turn macros back on again at the end.

    Please Login or Register  to view this content.
    _________________
    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
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Hide columns based on autofilter selection

    Hi JB,

    Thanks for the reply, thing is this is the only macro within this workbook/sheet.

    It physically loops through this marco over and over as when it pastes ....

    Ok...mid sentance.. a light bulb has just clicked and I think I have worked it out..

    It loops as it continously pastes over and over, thus re-calc each time.

    All I've done is change the copy and paste to and activecell.value and there are no calcs.

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

    Re: Hide columns based on autofilter selection

    I'm sorry, are you asking another question in there somewhere? Did you try the suggestion? Results?

+ 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