我在行For i = LBound(buyArrayLow) To UBound(buyArrayLow)
上收到运行时错误13,buyArrayLow
和buyArrayHigh
中有值。
Dim i As Long, j As Long, n As Long
Dim buyRngLow As Range
Dim buyRngHigh As Range
Dim buyArrayLow As Variant
Dim buyArrayHigh As Variant
Dim TempAr() As String
Set buyRngLow = Range("D" & lStartBuyRange)
Set buyRngHigh = Range("D" & lEndBuyRange)
buyArrayLow = buyRngLow.Value
buyArrayHigh = buyRngHigh.Value
For i = LBound(buyArrayLow) To UBound(buyArrayLow)
For j = LBound(buyArrayHigh) To UBound(buyArrayHigh)
If buyArrayLow(i, 1) = buyArrayHigh(j, 1) Then
boolFound = True
Exit For
End If
Next j
If boolFound = False Then
ReDim Preserve TempAr(n)
TempAr(n) = buyArrayLow(i, 1)
n = n + 1
Else
boolFound = False
End If
Next i