You need to follow the variable Threshold.
Look at the Sub SegmentPortion2(D1, D2, E1, E2, Threshold, Vals, XVals) where
1.D1 and D2 are 2 distance values and E1 and E2 are 2 elevation values
2. Threshold is updated in this sub too.

You're probably better plotting the chart progressively while running through the code with F8, then you'll get a good visual of where you're at. The section update chart at the end of blah2 can be duplicated and put inside the forward and backward loops: For i = PointNo + 1 To UBound(Dists) - 1 and For i = PointNo To LBound(Dists) + 1 Step -1