Calculating all but 1 Worksheet

  • Hi all


    Excel: I'm running a code where I disable my automatic calculation and then manually calculate everytime I need to. But one of the spreadsheets in my workbook has a huge amount of formulas and it's takes quite long to recalculate. I don't need any of the info on this sheet for my macro. Is it possible to re-calculate all the spreadsheets (in my macro code) except the one that has all the formulas.


    F

  • Re: Calculating all but one spreadsheet


    with a for each loop and checking for the name not equal THE spreadsheet you should be able to recalc the others


    Code
    Dim sh As Worksheet
    
    
      For Each sh In Worksheets
        If Not sh.Name = "TheSheet" Then sh.Calculate
      Next


    filo65



    P.S.
    Just one thing:
    you could get in trouble with "dependencies"

  • Re: Calculating all but one spreadsheet


    Hi again,


    I found an inelegant but effective solutionto your problem:


    replace all "=" with i.e "filo65=" in the sheet(s) you don't want calculate, calculate the workbook and replace then back "filo65=" with "="



    Awful, isn't it? but it works


    HTH


    filo65

Participate now!

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