How do I force all functions within a cell or worksheet to bere-evaluated without doing it manually?

M

mike

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_TABLE_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_TABLE_3," & row & ", " &
column & ", 1, 1)")


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

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

Top