- Sub peitao()
- Dim i&, n
- n = 100000
- Range("i3:i" & Range("c65536").End(xlUp).Row).ClearContents
- For i = 3 To [c65536].End(3).Row
- If n > Cells(i, 8) / Cells(i, 6) Then n = Cells(i, 8) / Cells(i, 6)
- If Cells(i + 1, 2) <> "" Or i = [c65536].End(3).Row Then
- Range(Cells(i, 9), Cells(i - Cells(i, 2).MergeArea.Count + 1, 9)).Merge
- Cells(i, 9).MergeArea = Application.Max(0, n)
- n = 100000
- End If
- Next i
- End Sub
复制代码 |