这玩意用条件格
式不就好了,为啥还要vba,如图所示
Sub zuida8()
Dim ma(8), add(8)
Dim i%
Columns(6).Interior.ColorIndex = 0
For i = 1 To 8
ma(i - 1) = WorksheetFunction.Max(Columns(6))
add(i - 1) = WorksheetFunction.Match(ma(i - 1), Columns(6), 0)
Cells(add(i - 1), 6).Interior.ColorIndex = 6
Cells(add(i - 1), 6) = ""
Next
For i = 1 To 8
Cells(add(i - 1), 6) = ma(i - 1)
Next
End Sub
'真没必要用VBA,不过给你写了段代码,也许你有别的用处
提示:冒泡排序,然后取前8个