VBA UDF Calculation (not)

  • Thread starter Thread starter Greg Longtin
  • Start date Start date
G

Greg Longtin

To all,

I've got a UDF, but Excel will only calc it when the cell containing it is
edited, ie, F2, enter.

How can I force a calc? I tried 'Calculate' on the SheetActivate event, and
nothing happens...

TIA,

Greg
 
What are the inputs to the UDF? Does it use any data not passed as a parameter?
 
Tim,
What are the inputs to the UDF? Does it use any data not passed as a
parameter?

One cell value, which is the name a worksheet in the workbook to use for the
calculation.

Greg
 
Greg,
Excel normally does not recalculate functions if their inputs have not
changed.
But may be application.Volatile will give the desired behaviour.

NickHK
 
Tim,

Found a solution. Simply put, the udf find a date in other sheets, and it's
used in a summary sheet. I orginally set it up with one parameter, which
tells it what sheet to use. The workbook is a summary of our truck
maintanance (one sheet per), and the udf is used in the summary page.

Anyway, the summary sheet has a cell that uses TODAY() for revision date. I
added this as a parameter to the UDF, and although I'm not using it for
anything, it forces the recalc.

Thanks,

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top