Force Cells To Recalculate (simulate Double Click?)

  • Hello again,


    I have an interesting question for everybody here. Let me see how to best explain it.


    I start in the code making sure column Action Plan completion has a value in it. Copying in the issue modified column if neccesary.


    Later, I place this formula in a given cell.

    Code
    =IF(I9="Open-Remediated",M9-K9, IF(I9="Closed-Remediated and Validated",M9-K9,"" ))


    The info I copied above is placed into the column K.


    When I run the macro, the cell formula outputs "#value".


    However, if I go double-click then enter the cell calculates just fine.


    I've tried excels overall recalculate function, but that doesn't change this.


    Does anybody know how to simulate a double-click on a cell?


    Any other suggestions?


    Thanks,


    Tom

  • Re: Force Cells To Recalculate (simulate Double Click?)


    I think we'd be interested first in seeing the rest of your code.

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

  • Re: Force Cells To Recalculate (simulate Double Click?)


    Code
    Application.Volatile


    Quote


    Volatile Optional Variant. True to mark the function as volatile. False to mark the function as nonvolatile. The default value is True

  • Re: Force Cells To Recalculate (simulate Double Click?)


    Plus, you should be sure you're using a statement like unto this:

    Code
    ActiveCell.FormulaR1C1 = "=IF(Blah,Blah,Blah)"


    or else you could be writing text to the cell which requires Excel to "RE" evaluate the cell (the double clicking).


    Jim

  • Re: Force Cells To Recalculate (simulate Double Click?)


    Thanks for the comments. I'm not sure function.volatile is the right approach here since the recalculation is in the excel cell, not the vba module. but I could be wrong. For those who wanted more code, here is the code I use to assemble all the formulas. It is much more expansive than section that causes the error. The formula that has the problem is strformhistoricalunremed.


    Any additional thoughts?


    Thanks,


    Tom


  • Re: Force Cells To Recalculate (simulate Double Click?)


    Tom,


    You might try these, in decreasing order of preference:

    Code
    Range(problemRange).Calculate
        Application.CalculateFull
        Application.CalculateFullRebuild

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

Participate now!

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