Getting a specific value from excel chart with vba -
i trying specific value excel chart. code creates chart (i created reversed binomial distribution plot) :
dim lim string dim n long n = range("c4").value dim x, s, p double x = range("c6") 'event number s = range("c5") 'sample size dim g() long dim h() double dim k() double dim prob() double redim g(n) redim prob(n) redim h(n) redim k(n) = 1 n g(i) = h(i) = / n k(i) = 1 - h(i) prob(i) = worksheetfunction.binomdist(x, s, h(i), false) * 100 end if i need point y 0 on distribution curve second time.
at end of for loop, check if prob(i) = 0 , prob(i-1) > 0, , save index of point. it's "too" simple, yet if kind of distribution, job :
dim targetindex integer = 1 n g(i) = h(i) = / n k(i) = 1 - h(i) prob(i) = worksheetfunction.binomdist(x, s, h(i), false) * 100 if > 1 'check if not first point if prob(i) = 0 , prob(i-1) <> 0 targetindex = end if next '// point couple (targetindex, prob(targetindex)) 
Comments
Post a Comment