|
排名表的数据获取你还是用SQL好了 排名用下面的代码
你在排名表 执行这段代码应该就可以了
Sub 排名()
For i = 0 To 10
Cells(3, 6 + i * 2).FormulaR1C1 = "=IF(RC[-1]="""","""",RANK(RC[-1],C[-1]))"
Cells(3, 6 + i * 2).AutoFill Destination:=Range(Cells(3, 6 + i * 2), Cells(Cells(65536, 1).End(xlUp).Row, 6 + i * 2)), Type:=xlFillDefault
Range(Cells(3, 6 + i * 2), Cells(Cells(65536, 1).End(xlUp).Row, 6 + i * 2)).Copy
Cells(3, 6 + i * 2).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next
Application.CutCopyMode = False
End Sub
[ 本帖最后由 mxf21cn 于 2011-3-8 09:13 编辑 ] |
|