Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Goal Seek
Hi,
I wrote the following code to calculate IRR. Sub IRR() Dim X As String X = Range("F9").Value Range("H9").GoalSeek Goal:=X, ChangingCell:=Range("F4") End Sub This works fine alone, but when I put it in a Command Button and use: Call IRR I get the following error: "GoalSeek Method of Range Class Failed" Does anyone know what the problem is? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Goal Seek
Just a guess, but:
If your using Excel 97, change the takefocusonclick property of the command button to false. -- Regards, Tom Ogilvy "Jeff" wrote in message ... Hi, I wrote the following code to calculate IRR. Sub IRR() Dim X As String X = Range("F9").Value Range("H9").GoalSeek Goal:=X, ChangingCell:=Range("F4") End Sub This works fine alone, but when I put it in a Command Button and use: Call IRR I get the following error: "GoalSeek Method of Range Class Failed" Does anyone know what the problem is? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Goal Seek
Thanks
That solution worked for me. "Tom Ogilvy" wrote: Just a guess, but: If your using Excel 97, change the takefocusonclick property of the command button to false. -- Regards, Tom Ogilvy "Jeff" wrote in message ... Hi, I wrote the following code to calculate IRR. Sub IRR() Dim X As String X = Range("F9").Value Range("H9").GoalSeek Goal:=X, ChangingCell:=Range("F4") End Sub This works fine alone, but when I put it in a Command Button and use: Call IRR I get the following error: "GoalSeek Method of Range Class Failed" Does anyone know what the problem is? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Please Help With Goal Seek | New Users to Excel | |||
goal seek | Excel Discussion (Misc queries) | |||
Goal Seek | Excel Discussion (Misc queries) | |||
Goal Seek | Excel Worksheet Functions | |||
Goal Seek (in VBA) | Excel Programming |