我有一个问题。我正在尝试将所有唯一值(数字和字母数字)从动态工作表复制到另一个工作表。我在一个论坛上找到了一个很棒的脚本,它运行迅速并且已经适应了它。问题是它似乎过滤掉了所有数值,而我这辈子看不到为什么!?!你能帮我吗?
Sub GetUniqueItems()
Dim vData As Variant, n&, lLastRow&, sMsg$
lLastRow = Worksheets(Worksheets("Summary").Range("A1").Value)._
Cells(Rows.Count, "H").End(xlUp).Row
If lLastRow = 1 Then Exit Sub '//no data
vData = Worksheets(Worksheets("Summary").Range("A1").Value)._
Range("H2:H" & lLastRow)
Dim oColl As New Collection
On Error Resume Next
For n = LBound(vData) To UBound(vData)
oColl.Add vData(n, 1), vData(n, 1)
Next 'n
For n = 1 To oColl.Count
sMsg = oColl(n)
Sheets("Summary").Cells(n + 3, 1).Value = Mid$(sMsg, 1)
Next 'n
End Sub