Saladsamurai
12-07-2009, 10:13 AM
Alright. I have a super simple Solver example in the attached workbook. I am solving the Equation 4*X=8.
I have the initial guess of X = 1 in cell A2 and I have Cell B2 = 4*A2.
I turned on the Macro recorder and solved the equation. I did not use any of the options. This is just a 'benchmark' to get things going. The following code was generated:
Option Explicit
Sub Solver1()
'
' Solver1 Macro
' Macro recorded 12/7/2009 by Saladsamurai
SolverOk SetCell:="$B$2", MaxMinVal:=3, ValueOf:="8", ByChange:="$A$2"
SolverSolve
End Sub
After viewing the code, I went back and changed the value of A2 (the initial guess) back to 1. I then went into the VBE and clicked on the http://i12.photobucket.com/albums/a220/saladsamurai/Play.jpg button.
I get the error message:
http://i12.photobucket.com/albums/a220/saladsamurai/errrrrr.jpg
Could someone explain to me what I am missing?
Thanks,
Casey
EDIT: WrkBk attached
I have the initial guess of X = 1 in cell A2 and I have Cell B2 = 4*A2.
I turned on the Macro recorder and solved the equation. I did not use any of the options. This is just a 'benchmark' to get things going. The following code was generated:
Option Explicit
Sub Solver1()
'
' Solver1 Macro
' Macro recorded 12/7/2009 by Saladsamurai
SolverOk SetCell:="$B$2", MaxMinVal:=3, ValueOf:="8", ByChange:="$A$2"
SolverSolve
End Sub
After viewing the code, I went back and changed the value of A2 (the initial guess) back to 1. I then went into the VBE and clicked on the http://i12.photobucket.com/albums/a220/saladsamurai/Play.jpg button.
I get the error message:
http://i12.photobucket.com/albums/a220/saladsamurai/errrrrr.jpg
Could someone explain to me what I am missing?
Thanks,
Casey
EDIT: WrkBk attached