LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with Solver & VBA ?

I'm trying to loop through rows of data and I'm having
trouble with the cell addresses. Microsoft's Solver
discussion only utilizes specific cell addresses and I'm
trying to change the target cell and constraint cells on a
row-by-row basis. CLearly I'm not addressing the cells
correctly by I'm not sure how to do it. Any help is
greatly appreciated. Thanks!


Here's the code:

Dim i As Integer ' Number of rows
Dim j As Integer ' Start row

i = Cells(11, 3)
For j = 14 To i

SolverOk SetCell:=Range("Cells(j, 14)"), MaxMinVal:=2,
ByChange:=Range("Cells(j,7):Cells(j,9)")
SolverAdd CellRef:=Range("Cells(j, 3)"), Relation:=1,
FormulaText:="Cells(j, 11)"
SolverAdd CellRef:=Range("Cells(j, 4)"), Relation:=1,
FormulaText:="Cells(j, 12)"
SolverAdd CellRef:=Range("Cells(j, 5)"), Relation:=1,
FormulaText:="Cells(j, 13)"

SolverSolve UserFinish:=True

SolverFinish KeepFinal:=1

Next j

 
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
Will Solver do the job? Mark Excel Discussion (Misc queries) 7 March 11th 09 01:33 AM
need help in SOLVER !! Ah NeL Excel Discussion (Misc queries) 1 December 26th 06 04:24 PM
Interesting Solver problem (Solver encounters an error) MrShorty Excel Discussion (Misc queries) 3 December 22nd 05 10:52 PM
Resetting Solver Manually to Fix Solver Bug Stratuser Excel Programming 0 September 13th 04 07:04 PM
Solver Reza[_2_] Excel Programming 1 July 25th 04 09:12 PM


All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"