excel - VBA Solver not Looping -


i trying use solver on multiple columns (the exact number of columns being defined user). after looking @ questions here, still can't find what's wrong code (i pretty new vba). when run it, works fine first year not apply following years.

dim wsfm_b3 worksheet set wsfm_b3 = thisworkbook.worksheets("xxxx_b3")  dim wscharts worksheet set wscharts = thisworkbook.worksheets("charts")  dim j integer  j = 0 range("cc_reduction_years").value     solverreset     solveradd cellref:=wsfm_b3.range("e_start").offset(0, j), relation:=3, formulatext:=wscharts.range("min_e")     solveradd cellref:=wsfm_b3.range("bank_start").offset(0, j), relation:=3, formulatext:=wsfm_b3.range("cash_b3")     solverok setcell:=wsfm_b3.range("poy_start").offset(0, j).address, maxminval:=3, valueof:=0, bychange:=wscharts.range("cc_base_start").offset(0, j).address, engine _         :=1, enginedesc:="grg nonlinear"     solversolve true   next j end sub 

here xxxx_b3 sheet looks like:

link image

on "charts" sheet there cells containing target values first line, constraints, , number of years.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -