|
- Sub 字符去重复ByMicro()
- Dim vData As Variant, nRow As Integer
- Dim dicData As Object, vDic As Variant, nDic As Integer
-
- Application.ScreenUpdating = False
- Set dicData = CreateObject("Scripting.Dictionary")
- vData = Sheet4.UsedRange.Offset(1).Resize(, 1).Value
- For nRow = 1 To UBound(vData) - 1
- vDic = Split(vData(nRow, 1), ",")
- dicData.RemoveAll
- For nDic = 0 To UBound(vDic)
- dicData(vDic(nDic)) = 0
- Next
- vData(nRow, 1) = ""
- For Each vDic In dicData
- If vData(nRow, 1) <> "" Then vData(nRow, 1) = vData(nRow, 1) & ","
- vData(nRow, 1) = vData(nRow, 1) & vDic
- Next
- Next
- Sheet4.[C2].Resize(UBound(vData) - 1) = vData
- End Sub
复制代码 |
|