VBA 数组 下标越界问题
Subq()m=0DimPosArr()Forl=1ToN*225m=m+1ReDimPreservePosArr(1Tom,1To2)Forll=2ToR2IfAbs(...
Sub q()
m = 0
Dim PosArr()
For l = 1 To N * 225
m = m + 1
ReDim Preserve PosArr(1 To m, 1 To 2)
For ll = 2 To R2
If Abs(Sheet3.Cells(ll, C1 - 3).Value - DT(m)) < 0.000694 Then
PosArr(m, 1) = ll
PosArr(m, 2) = ll
End If
If Sheet3.Cells(ll, C1 - 3).Value < DT(m) And Sheet3.Cells(ll + 1, C1 - 3).Value > DT(m) Then
PosArr(m, 1) = ll
PosArr(m, 2) = 0
End If
Next ll
Next l
End Sub 展开
m = 0
Dim PosArr()
For l = 1 To N * 225
m = m + 1
ReDim Preserve PosArr(1 To m, 1 To 2)
For ll = 2 To R2
If Abs(Sheet3.Cells(ll, C1 - 3).Value - DT(m)) < 0.000694 Then
PosArr(m, 1) = ll
PosArr(m, 2) = ll
End If
If Sheet3.Cells(ll, C1 - 3).Value < DT(m) And Sheet3.Cells(ll + 1, C1 - 3).Value > DT(m) Then
PosArr(m, 1) = ll
PosArr(m, 2) = 0
End If
Next ll
Next l
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询