A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Thank you, Ossie. I tried running this code and it appears that nothing happens. I'm not sure why that is.
Conceptually, I believe I see what you're trying to do. We're just defining strLastCol as the address of the last nonblank cell in the fifth row. Then we're defining vr as the range beginning with a known cell, C5, and end with the strLastCol.
Conceptually, this is exactly what I need and I thank you for thinking this through and simplifying it a few times.
But now when I run the macro, it processes 'something' (i.e. a blue circle cursor for about two seconds), but then nothing happens or changes. If I open the Solver dialogue box, it is blank (appearing that nothing recently happened in there.)
Any thoughts?
- Drew
Here is my current code:
=====================================================
Sub Step10_SolverMin()
Sheets("Calcs").Select
Dim vr
Dim strLastCol As String
Sheets("Calcs").Select
With Worksheets("Calcs")
strLastCol = .Cells(5, .Columns.Count).End(xlToLeft).Address
End With
vr = "Calcs!$C$5:$" & strLastCol
Application.Run "SolverReset"
Application.Run "SolverAdd", "$A$6", 2, "1"
Application.Run "SolverAdd", "$A$28", 2, "$A$31"
Application.Run "SolverOk", "$A$25", 2, "0", vr
Application.Run "SolverSolve", True
End Sub
======================================================