#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please Help With Goal Seek Laura[_3_] New Users to Excel 6 August 3rd 08 06:32 PM
goal seek tikchye_oldLearner57 Excel Discussion (Misc queries) 3 August 31st 06 02:52 PM
Goal Seek Jake Excel Discussion (Misc queries) 1 June 12th 05 05:55 AM
Goal Seek Tiya Excel Worksheet Functions 1 May 11th 05 12:38 PM
Goal Seek (in VBA) Tushar Mehta[_6_] Excel Programming 1 August 18th 03 04:18 AM


All times are GMT +1. The time now is 04:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"