Results 1 to 5 of 5

Macro to automate Solver

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2024
    Posts
    2,888

    Macro to automate Solver

    I have the following macro for updating values using Solver


     Option Explicit
    Sub Solver()
    
        SolverOk SetCell:="$E$1", MaxMinVal:=3, ValueOf:=72, ByChange:="$E$2:$E$27", _
            Engine:=2, EngineDesc:="Simplex LP"
        SolverOk SetCell:="$E$1", MaxMinVal:=3, ValueOf:=72, ByChange:="$E$2:$E$27", _
            Engine:=2, EngineDesc:="Simplex LP"
        SolverSolve
    End Sub
    I need the macro amended as follows:


    1) I need ValueOf:=72 to refer to cell F1

    2) I need $E$$27 to refer to the last cell in Col D in ByChange:="$E$2:$E$27"


    Your assistance in this regard is most appreciated

    I have also posted on

    https://www.mrexcel.com/board/thread...-code.1176711/

    https://www.myonlinetraininghub.com/...ing-vba#p21541
    Last edited by Howardc1001; 07-18-2021 at 10:14 PM. Reason: Amend Code

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro Sover Loop Help
    By Fiona149 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2014, 08:42 AM
  2. using VBA to paste values obtained with sover.
    By Juddel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2013, 08:39 AM
  3. Macro to autom. display images from URL, resize picture and move and size with cell
    By AshtonMcFish in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2013, 06:38 AM
  4. [SOLVED] VB to autom. Sort / Page Break
    By elgato74 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2009, 11:05 AM
  5. [SOLVED] COUNTIF function to autom. Underline
    By elgato74 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2009, 06:39 AM
  6. autom update cells from WB1 to WB2
    By Bruno01 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2005, 03:28 PM

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