Consulting

Results 1 to 4 of 4

Thread: SOLVEROK

  1. #1

    Cool SOLVEROK

    I have recorded following Solver VBA code

    It works fine except I want to set the value to be referenced to cell Q56 (see highlighted), when I adjust the highlighted part to ValueOf:="$Q$56" it doesn't work anymore.

    Secondly the code must be triggered when Cell E10 get to a value of 4 or 5 and cell R19=0
    Cell R19 will display 1 up and untill all necessary data is completed for the calculations.

    Sub Solveyman()
    Range("R56").Select
    ActiveCell.FormulaR1C1 = "0"
    SolverReset
    SolverOk SetCell:="$S$56", MaxMinVal:=3, ValueOf:="270.331", ByChange:="$R$56"
    SolverSolve True

    End Sub


    Thanks
    Last edited by willemeulen; 01-15-2010 at 02:11 AM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Have you tried

    [vba]

    ValueOf:=Range("Q56").Value
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Works a treat, thanks for that XLD!

    Better idea for other question, I will create a cell which displays True or 1 depending if conditions are met stated in my first post (Cell A10 value is 4 or 5 and cell R19 is 0)

    How do I trigger the macro when a specific cell is TRUE?

    W
    Last edited by willemeulen; 01-15-2010 at 04:07 AM.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Use the worksheet change or calculate event (depending pon how it is set).
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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