Stared at this for some time and don't understand (sorry, quite new to this!):

If Slope <> PreviousSlope And PreviousSlope <> 0 Then
'Range(Range("B2:B102").Cells(i - 1), Range("B2:B102").Cells(IIf(PreviousSlope = 1, lastup, lastDown))).Offset(, 3).Value = IIf(PreviousSlope = 1, "Max", "Min")

Quote Originally Posted by p45cal View Post
I haven't worked it out yet - it may be some time.
I gave you a start.