Похоже, вы хотите найти наибольшее последовательное различие, если так, попробуйте это ...
Public Function GetLargestDifference(ByVal objCells As Range) As Double
Dim objCell As Range, i As Long, dblThisDiff As Double, arrValues()
' Put the (potentially) non sequential set of cells into a one dimensional array.
For Each objCell In objCells
ReDim Preserve arrValues(i)
arrValues(i) = objCell.Value
i = i + 1
Next
' Now process that array and check for the max difference.
For i = 0 To UBound(arrValues) - 1
dblThisDiff = arrValues(i) - arrValues(i + 1)
If dblThisDiff > GetLargestDifference Then GetLargestDifference = dblThisDiff
Next
End Function
... нет проверки ошибок для нечисловых значений, но вы можете добавить этопри необходимости.
Если вам необходимо выполнить абсолютную проверку, замените эту строку ...
dblThisDiff = arrValues(i) - arrValues(i + 1)
... этой ...
dblThisDiff = Abs(arrValues(i) - arrValues(i + 1))