Regarding goal-seek or fsolve (matlab) alike function in VBA -
i have been struggling while try , implement goal-seek function in vba, no results, why turning guys.
i have variant of double-values, last element temporary set value, have changed (as in goalseek) sum of entire array equals 1. of course in worksheet, need in vba, handling no cells...
is there way call goalseek function in vba without having use worksheet (or cells), , instead working variables?
thanks, niklas
if it's filling last array item code might come in handy:
sub filllastelementwithdifferencetoone() dim arr variant dim integer, sum double redim arr(1 10) 'fill array .01 - .09 = lbound(arr) ubound(arr) arr(i) = / 100 next 'calculate sum = .45 = lbound(arr) ubound(arr) - 1 sum = sum + arr(i) next 'set last item of array arr(ubound(arr)) = 1 - sum 'clean set arr = nothing end sub
otherwise please specify want accomplish vba , problems , post code problems occur.
Comments
Post a Comment