Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In an effort to simplify my spreadsheet, I took some of the more ornerous cell formulas and converted them to VB. In the VB function I make heavy use of the Range("xxx").Value to actualy retrieve certain cell contents
For instance year(Range("Birth_Date_Spouse").Value My problem is now I have to hit <ctrl<alt<F9 in order to have the worksheet recalculate. If I change a cell which is referenced by "Range" in my VB function, cells depending upon the function do not automatically recalculate. I have the calculation set to "automatic" in the options Any ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try application.calculate in your code -- Regards Frank Kabel Frankfurt, Germany "Bill Buckner" schrieb im Newsbeitrag ... In an effort to simplify my spreadsheet, I took some of the more ornerous cell formulas and converted them to VB. In the VB function I make heavy use of the Range("xxx").Value to actualy retrieve certain cell contents. For instance: year(Range("Birth_Date_Spouse").Value) My problem is now I have to hit <ctrl<alt<F9 in order to have the worksheet recalculate. If I change a cell which is referenced by "Range" in my VB function, cells depending upon the function do not automatically recalculate. I have the calculation set to "automatic" in the options. Any ideas? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Frank
The function I wrote is used in a lot of cells. Will putting application.calculate in the function cause the entire workbook to be recalculated or only the cell in qquestion and any based upon it? I probably have a few hundred cells which use one of my functions. If it causes the whole workbook to get recalculated every time it is called, this calculation could last forever... Can you explain the rules that govern when and why cells are recalculated when custom functions are involved? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
sorry I misunderstood you: One way: include the cells which are used in your function as parameter. This way Excel knows when to re-calculate yourt function Another way: add the line application.volatile at the beginning of your function. This way your function is re-calculated everytime Excel re-calculates I would try to use the first way -- Regards Frank Kabel Frankfurt, Germany "Bill Buckner" schrieb im Newsbeitrag ... Frank, The function I wrote is used in a lot of cells. Will putting application.calculate in the function cause the entire workbook to be recalculated or only the cell in qquestion and any based upon it? I probably have a few hundred cells which use one of my functions. If it causes the whole workbook to get recalculated every time it is called, this calculation could last forever.... Can you explain the rules that govern when and why cells are recalculated when custom functions are involved? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, you can create a function for the Workbook_Change event that wil
call the other functions when there is a change to the sheet. Be sur to start the function off with Application.EnableEvents = False because if you don't, any changes made will retrigger the same event. End the function with Application.EnableEvents = True Let me know if you need more help. - Piku -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Balance sheet functions? | Excel Discussion (Misc queries) | |||
Stop and start Sheet recalculation | Excel Discussion (Misc queries) | |||
sheet! functions | Excel Worksheet Functions | |||
Spread sheet Functions | Excel Worksheet Functions | |||
Worksheet - Functions from sheet to sheet | Excel Discussion (Misc queries) |