|
Sub fyExcelVBA()
Dim arr, brr, crr, i%, j%
Dim m%, n%
Dim o, p, r, s
Set d = CreateObject("scripting.dictionary")
arr = Sheet11.Range("a10:p" & Sheet11.[d65536].End(3).Row)
ReDim brr(1 To UBound(arr), 1 To 7)
For i = 1 To UBound(arr)
d(arr(i, 1)) = arr(i, 1)
Next
With Worksheets("sheet1")
If Not d.exists(arr(i, 1).Value) Then
If arr(i, 4) <> "" Then
If arr(i, 4) = "安装" Then
n = n + 1
brr(n, 1) = arr(i, 1)
brr(n, 2) = arr(i, 2)
brr(n, 5) = arr(i, 3)
brr(n, 6) = arr(i, 6)
r = arr(i, 15)
s = arr(i, 16)
brr(n, 7) = DateSerial(2018, r, s)
End If
End If
End If
End With
Sheets("安装").Range("A" & Sheet1.Range("A65536").End(xlUp).Row + 1).Resize(UBound(brr), UBound(brr, 2)).ClearContents
Sheets("安装").Range("A" & Sheet1.Range("A65536").End(xlUp).Row + 1).Resize(UBound(brr), UBound(brr, 2)) = brr
End Sub
--------------------------------------------------
我用这个代码想判断一下第一个表格的数值是否在第二个表格中存在,然后再运行程序,依旧会报下标越界的错误,求大神指导
|
|