Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Force Recalc

On a given column I have a VBA function (which calls other functions
and accumulates the values, yielding a calculated weight for the data
on that row.) When I change the function, is there a way to allow/
force a recalc (F9, Shift-F9). Non of the data on the form has
changed, but the function to be applied to each row has been update,
so the resulting column for each row should be updated.

If I use the recalc sheet button, the value on every row in that
column is a copy of the output for the first row. [If I place the
cursor after the formula in the column I can force the function to
accurately weigh the data in that row. I can spot check some of the
rows, but I'd really like the worksheet to recalculate the value for
all 32,000 rows]

my perception is that when value changes in a dependent cell, the
formula will fire and update the target cell. I had understood, the
"Recalculate Worksheet" would force a recalculation for every cell
that is derived from a function. Apparently that doesn't work for me
either. [[ it calculates the first value, and then copies the value
into that column for all the rows, or alternatively shows a value
error.]

oh. yes. I'm very new at this. I am still trying to find the RTFM
that relates, but it's very hard to find.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Force Recalc

What happens if you end your code with:

"
Application.Calculation = xlAutomatic
Calculate

"

this should slove your problem. Let me know if it doesn't.

regards
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Force Recalc

This might be what you looking for:

VBA-Help Keyword: Volatile:

"Marks a user-defined function as volatile. A volatile function must
be recalculated whenever calculation occurs in any cells on the
worksheet. A nonvolatile function is recalculated only when the input
variables change. This method has no effect if it's not inside a user-
defined function used to calculate a worksheet cell.

Function My_Func()
Application.Volatile
...
end function"

Best wishes
Daniel
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Force Recalc

I added the Application.Volatile to the beginning of the parent
function

and the Application.Calculation=xlCalculateAutomatic
Calculate to the end of the function (prior to 'end function')

on exiting the edit for the module the spreadsheet shows the ongoing
recalculation progress until
all rows have been processed.

However, all rows ($T) show the same value as $1$T. Each row can be
recalculated to show the correct
value (trigger function evaluation row by row.)

this has been a big improvment, but I'm still not there..

(knowing how to phrase the question, is 75% of resolving the
problem.)
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Force Recalc


"KT_1010" wrote in message
...
On a given column I have a VBA function (which calls other functions
and accumulates the values, yielding a calculated weight for the data
on that row.) When I change the function, is there a way to allow/
force a recalc (F9, Shift-F9). Non of the data on the form has
changed, but the function to be applied to each row has been update,
so the resulting column for each row should be updated.

If I use the recalc sheet button, the value on every row in that
column is a copy of the output for the first row. [If I place the
cursor after the formula in the column I can force the function to
accurately weigh the data in that row. I can spot check some of the
rows, but I'd really like the worksheet to recalculate the value for
all 32,000 rows]

my perception is that when value changes in a dependent cell, the
formula will fire and update the target cell. I had understood, the
"Recalculate Worksheet" would force a recalculation for every cell
that is derived from a function. Apparently that doesn't work for me
either. [[ it calculates the first value, and then copies the value
into that column for all the rows, or alternatively shows a value
error.]

oh. yes. I'm very new at this. I am still trying to find the RTFM
that relates, but it's very hard to find.


Have you tried Application.Send ("^%{F9}")





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Force Recalc


"Mike" wrote in message
m...

"KT_1010" wrote in message
...
On a given column I have a VBA function (which calls other functions
and accumulates the values, yielding a calculated weight for the data
on that row.) When I change the function, is there a way to allow/
force a recalc (F9, Shift-F9). Non of the data on the form has
changed, but the function to be applied to each row has been update,
so the resulting column for each row should be updated.

If I use the recalc sheet button, the value on every row in that
column is a copy of the output for the first row. [If I place the
cursor after the formula in the column I can force the function to
accurately weigh the data in that row. I can spot check some of the
rows, but I'd really like the worksheet to recalculate the value for
all 32,000 rows]

my perception is that when value changes in a dependent cell, the
formula will fire and update the target cell. I had understood, the
"Recalculate Worksheet" would force a recalculation for every cell
that is derived from a function. Apparently that doesn't work for me
either. [[ it calculates the first value, and then copies the value
into that column for all the rows, or alternatively shows a value
error.]

oh. yes. I'm very new at this. I am still trying to find the RTFM
that relates, but it's very hard to find.


Have you tried Application.Send ("^%{F9}")


Whoops that should read Application.SendKeys ("^%{F9}")


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
Can't stop recalc [email protected] Excel Worksheet Functions 2 April 24th 09 01:29 PM
cell does not recalc revdeacon Excel Worksheet Functions 3 December 2nd 08 09:51 PM
Conditional Recalc CLR Excel Programming 4 May 3rd 07 04:21 PM
Automatic Recalc DME Excel Worksheet Functions 1 March 21st 05 08:05 PM
Force recalc of formulas saved as text T Kirtley Excel Programming 2 December 3rd 04 10:13 PM


All times are GMT +1. The time now is 04:01 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"