+ Reply to Thread
Results 1 to 3 of 3

Solver constraints not added through VBA

  1. #1
    Registered User
    Join Date
    06-18-2008
    Posts
    2

    Solver constraints not added through VBA

    I'm having problem in adding constaints to a mean variance optimizer model. The constraint range for asset weights (between 0% and 100%) are specified through 2nd and 3rd column of range "wts_matrix_mthly". All other constraints are added, except those where the weight is 100%, i.e., 1. I don't know why it doesn't add them. Manually I can add them, but through VBA, it just won't add them. I tried even macro recording, which generates the same code, but when added to procedure, it won't add the constraint where relation is 2, and formulatext is 1. If I set maximum weight to 80%, or 0.8, it will add the constraint, but not 100%. What can be the possible reason?

    Any help in this regard is appreciated. Thanks!

    Note: The cell reference "E275" is the sum of asset weights, which should be equal to 100%. Even that was not added; only when I manipulated it by multiplying the sum with 100 and then adding the constraint of 100 instead of 100% or 1, it worked.


    Please Login or Register  to view this content.
    Last edited by unikorn; 06-26-2008 at 06:34 AM.

  2. #2
    Registered User
    Join Date
    06-18-2008
    Posts
    2
    should i give up on this?

  3. #3
    Registered User
    Join Date
    03-16-2013
    Location
    Wisconsin, US
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Solver constraints not added through VBA

    See this thread

    I had the hardest time finding this, so glad I finally did

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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