Private Sub CommandButton1_Click()
Range("c:c").Replace ",", ""
Range("L2:R" & Range("R65536").End(xlUp).Row).ClearContents
Dim ArrYS
Dim d As Object
Dim i&
ArrYS = Range("B2:B" & Range("B65536").End(xlUp).Row)
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(ArrYS)
d(ArrYS(i, 1)) = d(ArrYS(i, 1)) + 1
Next i
Range("L2").Resize(d.Count, 1) = WorksheetFunction.Transpose(d.keys)
Range("M2").Select
ActiveCell.Formula = "=VLOOKUP(L2,B:C,2,0)"
Selection.AutoFill Destination:=Range("M2:M" & Range("L65536").End(xlUp).Row)
Range("N2").Select
ActiveCell.Formula = "=VALUE(RIGHT(VLOOKUP(L2,B:D,3,0),6))"
Selection.AutoFill Destination:=Range("N2:N" & Range("L65536").End(xlUp).Row)
Range("O2").Select
ActiveCell.FormulaR1C1 = "=SUMIFS(C[-8],C[-13],RC[-3])"
Selection.AutoFill Destination:=Range("O2:O" & Range("L65536").End(xlUp).Row)
Range("P2").Select
ActiveCell.Formula = "=COUNTIF($B:$B,$L2)+COUNTIF(存款总次数!$A:$A,IF(LEN(N2)=5,VALUE(z000000&N2),VALUE(z00000&N2)))"
Selection.AutoFill Destination:=Range("P2:P" & Range("L65536").End(xlUp).Row)
Range("Q2").Select
ActiveCell.Formula = "=IFERROR(VLOOKUP(M2,代码!A:B,2,0),"""")"
Selection.AutoFill Destination:=Range("Q2:Q" & Range("L65536").End(xlUp).Row)
Range("R2").Select
ActiveCell.Formula = "=COUNTIF(注册!$B:$B,L2)"
Selection.AutoFill Destination:=Range("R2:R" & Range("L65536").End(xlUp).Row)
End Sub
如题这是一段VBA代码,主要是谁能告诉我,这段代码是什么?大概讲解一下,用了什么语句,用了什么结构。把相应语句的结构告诉我一下