Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am trying to call GoalSeek within a function, but GoalSeek appears to only work if called from a sub. For example, calling the function below from a cell will not update any cells, but having a button call the function will. Is there some contraint that GoalSeek must be triggered by a sub instead of being called from a user-defined function? Function TestGoalSeek(rTarget As Range, rChange As Range, dblGoal As Double) As Double Call DoGoalSeek(rTarget, rChange, dblGoal) TestGoalSeek = rChange(1, 1) End Function Private Sub DoGoalSeek(rTarget As Range, rChange As Range, dblGoal As Double) 'Range("F11").GoalSeek Goal:=10, ChangingCell:=Range("E11") Dim b As Boolean b = rTarget.GoalSeek(dblGoal, rChange) End Sub Thanks, Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User Defined FUNCTION | Excel Discussion (Misc queries) | |||
user defined function | Excel Worksheet Functions | |||
User defined function | Excel Programming | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |