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.
Bookmarks