
'估计是这意思的吧,相同区间取最大值
Option Explicit
Sub abc()
Dim a, i, p, max
a = Range("a1:b" & Cells(Rows.Count, "b").End(xlUp).Row + 1).Value
ReDim b(1 To UBound(a) - 1, 1 To 1)
max = 10 ^ -8
For i = 1 To UBound(a) - 1
If a(i, 1) > max Then max = a(i, 1)
If a(i, 2) <> a(i + 1, 2) Or i = UBound(a) - 1 Then
b(p + 1, 1) = max: max = 10 ^ -8
p = i
End If
Next
[d1].Resize(UBound(b)) = b
End Sub