Results 1 to 11 of 11

macro solver based on selected row

Threaded View

  1. #1
    Registered User
    Join Date
    03-07-2018
    Location
    winnipeg, manitoba
    MS-Off Ver
    OFfice 2013
    Posts
    4

    macro solver based on selected row

    I have a specific solver that I need run, and all the information is organized per row. However, my data set is large and I don't need solver run for all rows. What I would like is to input a value into a cell (BB4), then have the macro search Column E for matching value. Once the row with the matching value is found, run a solver based on information in that row. All rows are set up the same, so column references will be the same regardless of which row is chosen.

    Input number into cell $BB$4.
    Search column E for cell value matching $BB$4
    Set variables for solver based on row

    rVa1l = cell (current row, 95)
    rVal2 = cell(current row, 50)
    rVal3 = range(current row, 25:26)
    
    Run solver with variables from above
    SolverOk SetCell:="rVal1", MaxMinVal:=3, ValueOf:=0, ByChange:="rVal3" _
           , Engine:=1, EngineDesc:="GRG Nonlinear"
        SolverAdd CellRef:="rVal1", Relation:=1, FormulaText:="rVal1"
        SolverAdd CellRef:="rVal2", Relation:=2, FormulaText:="0"
        SolverSolve userFinish:=True
    I am not sure if it is possible to run solver with variables, rather than cell references.
    Thanks,
    Last edited by bluescreamsblack; 03-09-2018 at 01:59 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to make solver solve for selected cells
    By fgnkrkrt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-20-2014, 05:27 PM
  2. [SOLVED] VBA macro to use solver on a user selected column of data
    By jdmccoskey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2014, 09:07 AM
  3. Replies: 0
    Last Post: 07-20-2014, 12:45 PM
  4. macro not keeping solver solutions when solver is successful
    By jimmypants in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2014, 01:45 AM
  5. [SOLVED] VBA: Solver - Sheet must be selected?
    By R22 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-12-2014, 02:48 PM
  6. Macro based on selected range
    By wsphthefirst in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-09-2013, 10:23 AM
  7. solver macro + simulation code + not updating solver values
    By sabinemaria in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2012, 11:37 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1