出于某种原因,当我执行以下代码时出现“运行时 13”错误。
Dim N_1 As Variant
Worksheets("Trucks").Activate
Range("G9").Activate
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
If ActiveCell.Value = "" Then Exit Do
Loop
ActiveCell.Offset(-1, 0).Select
N_1 = Range(ActiveCell, "G9")
With CreateObject("scripting.dictionary")
.comparemode = vbTextCompare
For Each v1 In N_1
If Not IsEmpty(v1) Then
If Not .exists(v1) Then .Add v1, Nothing
End If
Next
z1 = .keys
End With