运行错误9下标越界
的有关信息介绍如下:问题补充说明:Sub excel取不重复值() Dim d As Object Dim lRow As Long Dim i As Long Dim str As Variant Dim strKey As String Set d = CreateObject("scripting.dictionary") lRow = Range("R65536").End(xlUp).Row str = Range("R3:R" & lRow) For i = 1 To lRow strKey = CStr(str(i, 1)) If Not d.exists(strKey) Then d.Add strKey, strKey Range("T3").Resize(UBound(d.keys) + 1, 1) = Application.Transpose(d.keys) End If Next iEnd Sub
你是不是贴错代码了,或是贴错错误信息了,从你的代码来路钱室方朝他机攻愿输测看,应该不会有下标越界错误,就算后面的For循环可能出问题,前面也有OnE火种异批而周品rrorResumeNext语句,是不可能由于运行时错误而终断的.