|
Sub 宏8()
'
' 宏8 宏
'
'
Range("B3").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(R[-1]C1,登记表!R3C2:R12C13,COLUMN()+1,0)"
Range("B3").Select
Selection.AutoFill Destination:=Range("B3:K3"), Type:=xlFillDefault
Range("B3:K3").Select
Range("B4").Select
ActiveCell.FormulaR1C1 = "=AVERAGE(R[-1]C,登记表!R[-1]C[2]:R[8]C[2])"
ActiveCell.FormulaR1C1 = "=AVERAGE(R3C,登记表!R3C[2]:R12C[2])"
Range("B4").Select
Selection.AutoFill Destination:=Range("B4:H4"), Type:=xlFillDefault
Range("B4:H4").Select
Range("B5").Select
ActiveCell.FormulaR1C1 = "=RANK(R[-2]C,登记表!R[-2]C[2]:R[7]C[2])"
ActiveCell.FormulaR1C1 = "=RANK(R3C,登记表!R3C[2]:R12C[2])"
Range("B5").Select
Selection.AutoFill Destination:=Range("B5:H5"), Type:=xlFillDefault
Range("B5:H5").Select
Range("L5").Select
'
'
Range("B3:K5").Select
Selection.Copy
For counter = 1 To 3
ActiveCell.Offset(7, 0).Range("A1:J3").Select
ActiveSheet.Paste
Next counter
End Sub
刚学VBA 不足之处请指出 |
|