|
本帖最后由 小花鹿 于 2012-7-23 02:26 编辑
凑个热闹:
Sub test()
Dim ar, br(), i&, j&, d
Set d = CreateObject("scripting.dictionary")
ar = Range("b4:h" & [a65536].End(3).Row)
For i = 1 To UBound(ar)
For j = 1 To UBound(ar, 2)
If ar(i, j) <> "" And Not d.exists(ar(i, j)) Then
d(ar(i, j)) = d.Count
End If
Next j
Next i
ReDim br(1 To UBound(ar), d.Count)
For i = 1 To UBound(ar)
For j = 1 To UBound(ar, 2)
If d.exists(ar(i, j)) Then
br(i, d(ar(i, j))) = ar(i, j)
End If
Next j
Next i
[j4].Resize(i - 1, d.Count) = br
End Sub
将不同列中不同行的单元格内容相同的整理到同一列.rar
(9.82 KB, 下载次数: 81)
|
评分
-
1
查看全部评分
-
|