ds = s / 10
i = 0
Do Until yg = ym
yg = (weightp * (depth / 2) + weightl * (depth + s + (ds * i))) / (weightp + weightl)
i = i + 1
Exit Do
Loop
cheight = s + (ds * i)
what i want the code to do is too loop over and over again increasing the value of i every single time by 1 until ym = yg. i want it to then take that value of i and calculate cheight using that value. any ideas anyone? i dont know anything about programming and really am stuck