#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Goal Seek

I have a goal seek which is part of a bigger macro. The macro needs to
calculate the goal seek and then copy and paste the values 100 times
between 4 sheets. This should take not more than three minutes but of
late is failing to work. Not sure why it does not work.

Sub goal()
If Range("TotalCosts") 1 Then
Range("TargetCell1").GoalSeek goal:=Range("TargetValue1"),
ChangingCell:=Range("ChangeCell1")
Else
Range("ChangeCell1") = 0
End If
End Sub

This is what it is supposed to mean.

Costs: X

Revenue y ...... Changecell1


Profit z Profit percentage = Target cell1 which should be the
same as the Target value 1


The revenue will have to be calculated on the basis of a predefined
percentage of profit which is the target value 1 represented by the
change cell.

This should not take more than a second but it does take a long time
to come up with the value in the change cell.

Can anyone tell why it should not happen in 3 mins as it does not
happen now.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Goal Seek

try

with application
.EnableEvents=false
.ScreenUpdating=false
end with
' do goal seek
with application
.EnableEvents=true
.ScreenUpdating=true
end with


Fortune wrote:
I have a goal seek which is part of a bigger macro. The macro needs to
calculate the goal seek and then copy and paste the values 100 times
between 4 sheets. This should take not more than three minutes but of
late is failing to work. Not sure why it does not work.

Sub goal()
If Range("TotalCosts") 1 Then
Range("TargetCell1").GoalSeek goal:=Range("TargetValue1"),
ChangingCell:=Range("ChangeCell1")
Else
Range("ChangeCell1") = 0
End If
End Sub

This is what it is supposed to mean.

Costs: X

Revenue y ...... Changecell1


Profit z Profit percentage = Target cell1 which should be the
same as the Target value 1


The revenue will have to be calculated on the basis of a predefined
percentage of profit which is the target value 1 represented by the
change cell.

This should not take more than a second but it does take a long time
to come up with the value in the change cell.

Can anyone tell why it should not happen in 3 mins as it does not
happen now.

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 lawson Excel Discussion (Misc queries) 6 March 12th 08 02:37 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 Jeff Excel Programming 2 October 15th 04 07:27 PM


All times are GMT +1. The time now is 09:47 AM.

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"