VBA GoalSeek not Calculating

egoosen3

New Member
Joined
Mar 11, 2012
Messages
18
Hi

I have a spreadsheet where I run this code

Sub Solve_Cover()
'
' Solve_Cover Macro
'


Application.Calculation = xlCalculationAutomatic
With Application
.MaxIterations = 100
.MaxChange = 0.1
End With



Range("P13").GoalSeek Goal:=1.2, ChangingCell:=Range("AW13")


End Sub

the sheet is on automatic calculation, when i run the code the goal is not chanmging ( sheet does not calc)
Any suggestions
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Works fine for me. But you give us no information to suggest that you should expect to see a change.

You say that "the goal is not changing". Do you get a VBA error? If so, what error?

Before you run the macro, what is in P13 and AW13?

AW13 should not contain a formula; usually, it should be empty.

P13 should contain a formula that depends on AW13 directly or indirectly. Provide sufficient details (e.g. formulas in other cells) to demonstrate the dependency that P13 has on AW13.

Consider adding the following statement before performing GoalSeek:

ActiveSheet.EnableCalculation = True

Unless you want Goal Seek to use a value in AW13 as the starting point, add the following statement before performing GoalSeek:

Range("aw13").ClearContents

Finally, I am surprised that you set Application.MaxChange to 0.1. The default is 0.001. Unless you want to experiment with less precision, I suggest that you use 0.001 or better. (0.00001 is better for my example formula in P13.)

In any case, consider doing the following:

' before changing Iteration Parameters
oldMaxIterations = .MaxIterations
oldMaxChange = .MaxChange

' after performing GoalSeek:
Application.MaxIterations = oldMaxIterations
Application.MaxChange = oldMaxChange
 
Upvote 0

Forum statistics

Threads
1,214,867
Messages
6,122,002
Members
449,059
Latest member
mtsheetz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top