View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mike mike is offline
external usenet poster
 
Posts: 10
Default How do I force all functions within a cell or worksheet to bere-evaluated without doing it manually?

I currently have a MAIN TABLE of values whose source of values can
come from 1 of 3 other SOURCE TABLES. The way it selects the SOURCE
table is based on a set of values in multiple cells.
(I am basically multiplexing 3 tables to 1 depending on some selection
criteria.)

Each entry in the MAIN TABLE contains a formula that picks which one
of the three SOURCE TABLES to get the data for the cells from.

Anyway, the fomulas in the MAIN TABLE only get executed when I select
a cell in the MAIN TABLE and press enter.

My question is:
Is there a way to get the formulas to evaluate automatically
whenever the selection criteria changes?

Thanks - mike


------------------------------------------------------------------------------------------------------------------------
Here is my code for the formula in the cells for the MAIN TABLE that
does the
multiplexing of the three other tables.
The selection variables are named cells called "A" "B" and "C"
------------------------------------------------------------------------------------------------------------------------

Function GET_WEIGHT(row, column)

'------ Use table 2 ------
GET_WEIGHT =
ActiveSheet.Evaluate("=OFFSET(CRITERIA_WEIGHT_TABL E_2," & row & ", " &
column & ", 1, 1)")
Exit Function
End If


'------ Use table 3 ------
If [A = 1] And [B = 0] And [C = 0] Then
GET_WEIGHT =
ActiveSheet.Evaluate("=OFFSET(CRITERIA_WEIGHT_TABL E_3," & row & ", " &
column & ", 1, 1)")


'------ Use table 1 ------
Else
GET_WEIGHT =
ActiveSheet.Evaluate("=OFFSET(CRITERIA_WEIGHT_TABL E_1," & row & ", " &
column & ", 1, 1)")
End If
End Function