Dim MyBoot As Integer Dim MyBoots As Integer Dim Cfz As Integer
②按钮的代码
MyBoot = 0 ReDim iArray(0) For i = 2 To 1521 Cfz = 0 If (Application.WorksheetFunction.CountIf(Sheets(2).Range("C2:C1521"), Worksheets(2).Cells(i, 3)) > 1) Then For j = 0 To UBound(iArray) If (Worksheets(2).Cells(i, 3).Value = iArray(j)) Then Cfz = Cfz + 1 End If Next If (Cfz > 0) Then Else MyBoot = MyBoot + 1 ReDim Preserve iArray(0 + MyBoot) iArray(0 + MyBoot) = Worksheets(2).Cells(i, 3).Value End If End If Next Dim h As Integer For k = 0 To UBound(iArray) Worksheets(2).Cells(k + 2, 6).Value = iArray(k) MyBoots = 0 ReDim iArrays(0) h = 0 For m = 2 To 1521 If (iArray(k) = Worksheets(2).Cells(m, 3)) Then MyBoots = MyBoots + 1 ReDim Preserve iArrays(0 + MyBoots) iArrays(0 + MyBoots) = Worksheets(2).Cells(m, 4).Value End If Next For mm = 0 To UBound(iArrays) h = h + 1 Worksheets(2).Cells(k + 2, h + 6).Value = iArrays(mm) Next Next