|
- Sub 字典方法对数据中的型号规格去重()
- arr = Sheet1.Range("A1:B" & Sheet1.Cells(Rows.Count, "A").End(xlUp).Row)
- Dim dic As Object
- Set dic = CreateObject("scripting.dictionary")
- For i = 2 To UBound(arr)
- If Len(arr(i, 1)) Then
- Key = arr(i, 1) & "," & arr(i, 2)
- dic(Key) = ""
- End If
- Next
- keys = dic.keys
- ReDim brr(1 To dic.Count, 1 To 2)
- For i = 0 To dic.Count - 1
- k = k + 1
- s = Split(keys(i), ",")
- brr(k, 1) = s(0)
- brr(k, 2) = s(1)
- Next
- Sheet2.UsedRange.Offset(3).Clear
- Sheet2.Range("A4").Resize(k, 2) = brr
- End Sub
- Sub 直接复制()
- r = Sheet1.Cells(Rows.Count, "A").End(xlUp).Row
- Set Rng = Sheet1.Cells(3, 1).Resize(r, 2)
- Rng.Copy Sheet2.Range("A4")
- End Sub
复制代码
看不懂你结果中的型号
|
评分
-
1
查看全部评分
-
|