Hide Columns based on Date

  • Hello,
    I am trying to hide a range of columns based on a month in a date of a cell. There is some formula calculating number of months between two dates, essentially giving me a number between 1 and 48.
    I found a macro, which I used, however it happens every time I click on a cell and takes ~4 seconds to finish.


    Is there a way to insert this into the excel Date Picker? That only when its used, it ll launch the macro - something like a standard button would - or optimize this somehow?


    Below are first Three parts, it continues 45 more times -.-


    Thank you


  • Re: Hide Columns based on Date


    Adding...


    Code
    Application.ScreenUpdating = False
    Application.Calculation = xlcalculationmanual


    To the top of your code and...

    Code
    Application.ScreenUpdating = True
    Application.Calculation = xlcalculationautomatic


    To the end of your code will make it run much faster :)

    [SIZE=3]The Only Dumb Question Is A Question Not Asked.[/SIZE]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!