OilBoiler
Chemical
- Aug 5, 2003
- 43
Hi,
I'm finally getting this macro to work with the Excel Solver Function:
But right now that's what I'm doing... copying and pasting for every row. How can I modify this code to cover a range of cells? Do I have to name my ranges? What's the syntax for that? When I try to input a range of cells for the solver function, it tells me that the target cell can only be a single cell.
I appreciate your help as always.
Thanks!
I'm finally getting this macro to work with the Excel Solver Function:
Code:
Sub EthBal3()
'
' EthBal3 Macro
' Macro recorded 12/30/2005 by cabelkm
'
'
SolverOk SetCell:="$AF$5", MaxMinVal:=3, ValueOf:="0", ByChange:="$AA$5"
SolverSolve Userfinish:=True
SolverOk SetCell:="$AF$6", MaxMinVal:=3, ValueOf:="0", ByChange:="$AA$6"
SolverSolve Userfinish:=True
SolverOk SetCell:="$AF$7", MaxMinVal:=3, ValueOf:="0", ByChange:="$AA$7"
SolverSolve Userfinish:=True
SolverOk SetCell:="$AF$8", MaxMinVal:=3, ValueOf:="0", ByChange:="$AA$8"
SolverSolve Userfinish:=True
End Sub
But right now that's what I'm doing... copying and pasting for every row. How can I modify this code to cover a range of cells? Do I have to name my ranges? What's the syntax for that? When I try to input a range of cells for the solver function, it tells me that the target cell can only be a single cell.
I appreciate your help as always.
Thanks!