VBA 提示下标越界,哪里出了问题?
Sublqxs()DimArr,i&,Brr,dSetd=CreateObject("Scripting.Dictionary")Sheets("sheet2").Act...
Sub lqxs()
Dim Arr, i&, Brr, d
Set d = CreateObject("Scripting.Dictionary")
Sheets("sheet2").Activate
Arr = Sheets("sheet1").[a1].CurrentRegion
For i = 2 To UBound(Arr)
x = Arr(i, 1) & "|" & Arr(i, 2) & "|" & Arr(i, 3) & "|" & Arr(i, 4)
d(x) = Arr(i, 5)
Next
Brr = [a1].CurrentRegion
For i = 2 To UBound(Brr)
x = Brr(i, 1) & "|" & Brr(i, 2) & "|" & Brr(i, 3) & "|" & Brr(i, 4)
If d.exists(x) Then Cells(i, 5) = d(x)
Next
End Sub 展开
Dim Arr, i&, Brr, d
Set d = CreateObject("Scripting.Dictionary")
Sheets("sheet2").Activate
Arr = Sheets("sheet1").[a1].CurrentRegion
For i = 2 To UBound(Arr)
x = Arr(i, 1) & "|" & Arr(i, 2) & "|" & Arr(i, 3) & "|" & Arr(i, 4)
d(x) = Arr(i, 5)
Next
Brr = [a1].CurrentRegion
For i = 2 To UBound(Brr)
x = Brr(i, 1) & "|" & Brr(i, 2) & "|" & Brr(i, 3) & "|" & Brr(i, 4)
If d.exists(x) Then Cells(i, 5) = d(x)
Next
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询