View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 3
Default Need help writing Excel macro to solve a cell in each row of a spreadsheet


The code i have right now is the following, I'm also getting a "run-time
error '424': Object required"

Sub BetaSolver()

Do
Range("AT8").Select
ActiveCell.FormulaR1C1 = "1"
SolverReset
SolverOptions MaxTime:=100, Iterations:=100,
Precision:=0.000001, AssumeLinear _
:=False, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1,
_
IntTolerance:=1, Scaling:=False, Convergence:=0.000001,
AssumeNonNeg:=False
SolverOk SetCell:="$AX8", MaxMinVal:=2, ValueOf:="0", ByChange:="$AT8"
SolverAdd CellRef:="$AR8", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$AR8", Relation:=3, FormulaText:="-1"
SolverAdd CellRef:="$AS8", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$AS8", Relation:=3, FormulaText:="-1"
SolverAdd CellRef:="$AT8", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$AT8", Relation:=3, FormulaText:="-1"
SolverSolve UserFinish:=True
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(Active.Cell(0, -1))

End Sub


*** Sent via Developersdex http://www.developersdex.com ***