I am trying to run the code below. When I run this, I am getting the following error message:
OpenSolver Could not find an optimal solution, and reported: Infeasible
The Model contains a restraint 'I2:I160 >=1' for which instance 4does not depend on the decision variable and is not satisfied...
Hello All-
I'm hoping you can help me get to the bottom of a solver issue. I have a simple workbook that I created several years ago. After a few recent modifications, it no longer works. I get the "solver encountered an error in the objective cell or a constraint cell" error and cannot...
Note: This was originally posted at https://www.excelforum.com/excel-programming-vba-macros/1274124-help-with-arrays.html
I have not been able to get any responses to addressing this.
My apologies if this doesn't make sense, I am new to using arrays and have been trying to research this but...
First, I have the code below. When I run this, a new spreadsheet is created as expected. When the data is placed on the new spreadsheet, it puts all of the selected values that I am trying to solve for (A2 to A134) instead of just the solver results, 6 of the values as determined by Solveradd...
Sorry for the long post, any help is appreciated.
I am working on the Macro below. I am hoping someone can provide a little guidance on a few questions.
1. Should the Marco be in Module1, The spreadsheet I am running it against or in ThisWorkbook?
2. I can run the solver without an issue...
I want to VBA Solver search parameter array like as 5, 8, 11, 14, 17...60 step 3, I use SolverAdd code as follow but not work?Why
[W4] as parameter start 5
Range("step") = 3
SolverAdd CellRef:=[W4], Relation:=2, FormulaText:=2+Range("step")*Int([W4]/Range("step"))
Hi ,
I wrote a code to run solver , unfortunately after 10 loops the results are not optimal.
This is the code :
Sub Solver()
Dim Pro As Range
Dim Dem As Range
Dim Tot_Pro As Range
Dim Start_Row As Integer
Dim End_Row As Integer
Dim i As Integer
Dim j As Integer
Application.ScreenUpdating...
Hi,
I am reviewing a macro. There is logic that appears to use the solver, but I wasn't sure.
SolverReset
SolverOk SetCell:="$E$7", MaxMinVal:=3, ValueOf:="0", ByChange:="$D$16"
SolverOptions AssumeNonNeg:=False
SolverAdd CellRef:="$D$16", Relation:=1, FormulaText:="0.05"...
Is there any way to call a variable from VBA as the input for FormulaText in SolverAdd?
Sub ()
intX=5
SolverAdd CellRef:=Range("A1"),Relation:=1, FormulaText:=intX
End Sub
Hello all,
I'm currently working on my thesis, i have about 2 weeks left before i have to hand it in. The problem lays within my macros. I have 5 macros in my sheet, when i protect the sheets, they stop working, all except 1 which is a simple print macro. I will post the macro text here, if you...
Hi there,
I need to check some conditions applied to a sheet using Solver Addin. I recorded the action when adding them :
SolverOk SetCell:="$B$13", MaxMinVal:=1, ValueOf:=0, ByChange:="$B$11:$D$11", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="$B$11"...
It seems like this is going to be simple, but I can't figure out the correct way to fix my infinite loop problem.
I have a worksheet (Batch Sizing) which leverages Excel solver to find the right optimized batch size for planning. I'm worried about the placement of End statement as the routine...
favorite
I am trying to use solver to find the root for 182 cells, each cell is depend only on one another variable, the output cell is from O2 to O183, the variable cell is from P2 to P183. I am trying to change the variable cells to have the output cell equal to 1. The code works but the...
The code below is part of a macro that programmatically sets criteria in Solver and runs Solver. The process has appeared to have worked perfectly for multiple machines and versions of Excel for about a year. I am using Excel 2003. However, I have come across an error that I cannot fathom. When...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.