Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA functions not calculating automatically

I have created a few functions in VBA in XL XP, all of which work
beautifully, but only if I click on the cell containing it, then in the
edit window at the top and press enter to run it. I have calculation
set to automatic in Tools/Options. It won't even run if I press F9!
Naturally, I would like the functions to calculate automatically--just
as my other Excel functions do.

Can anyone help shed light on what is going on here?

Much thanks,

Paul.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default VBA functions not calculating automatically

often you must include the line
application.volatile
as the top line in the udf.

"paulsza" wrote in message
...
I have created a few functions in VBA in XL XP, all of which work
beautifully, but only if I click on the cell containing it, then in the
edit window at the top and press enter to run it. I have calculation
set to automatic in Tools/Options. It won't even run if I press F9!
Naturally, I would like the functions to calculate automatically--just
as my other Excel functions do.

Can anyone help shed light on what is going on here?

Much thanks,

Paul.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA functions not calculating automatically

do
Ctrl+Alt+F9

Excel recalculates only cells that need to be recalculated. It determines
if your function needs recalculation by checking if any cells it depends on
have changed. It identifies these by looking at the arguments to the
function. If you functions don't use cell references, then you need to make
them volatile so they are recalculated on every calculation. As the first
line of the function, put in

Application.Volatile

If you can avoid this by having dependencies in the arguments, this will be
much better.

--
Regards,
Tom Ogilvy

paulsza wrote in message
...
I have created a few functions in VBA in XL XP, all of which work
beautifully, but only if I click on the cell containing it, then in the
edit window at the top and press enter to run it. I have calculation
set to automatic in Tools/Options. It won't even run if I press F9!
Naturally, I would like the functions to calculate automatically--just
as my other Excel functions do.

Can anyone help shed light on what is going on here?

Much thanks,

Paul.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculating dates automatically Megan Excel Discussion (Misc queries) 6 November 21st 07 05:40 PM
WB Not Calculating Automatically Jon Martin Excel Worksheet Functions 1 October 10th 06 02:33 PM
Functions not Calculating PatK Excel Worksheet Functions 6 August 24th 06 05:55 PM
Not Automatically Calculating Formulas Archie Excel Worksheet Functions 2 January 20th 06 12:43 PM
My Formulas aren't automatically re-calculating Chantel Excel Worksheet Functions 5 March 18th 05 04:39 PM


All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"