Thread: Goal Seek
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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