|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub lfy_Adele_sz()
- Dim arr, brr(), x&, y&, z&, k&
- Dim crr, drr, d, d1, d2
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- Set d2 = CreateObject("Scripting.Dictionary")
- With Sheets("call")
- arr = .Range("a1").CurrentRegion
- ReDim brr(1 To UBound(arr), 1 To 14)
- For x = 2 To UBound(arr)
- If arr(x, 23) <> "" Then
- k = k + 1
- brr(k, 1) = arr(x, 23): brr(k, 2) = arr(x, 19)
- brr(k, 3) = arr(x, 13): brr(k, 4) = arr(x, 11)
- End If
- Next x
- End With
- With Sheets("机器编号")
- crr = .Range("a1").CurrentRegion
- For y = 2 To UBound(crr)
- If Not d.exists(crr(y, 5)) Then
- d(crr(y, 5)) = crr(y, 6)
- End If
- Next y
- End With
- With Sheets("ASM坏件登记")
- drr = .Range("a1").CurrentRegion
- For i = 2 To UBound(drr)
- s = drr(i, 2) & "," & drr(i, 5)
- ys = .Cells(i, 9).Interior.ColorIndex
- If Not d1.exists(s) Then
- d1(s) = Array(drr(i, 1), drr(i, 9), ys)
- End If
- Next i
- End With
- With Sheets("MLS坏件登记")
- frr = .Range("a1").CurrentRegion
- For a = 2 To UBound(frr)
- sf = frr(a, 4) & "," & frr(a, 2)
- If Not d2.exists(sf) Then
- d2(sf) = ""
- End If
- Next a
- End With
- For z = 1 To UBound(brr)
- If d.exists(brr(z, 2)) Then
- brr(z, 5) = d(brr(z, 2))
- End If
- ss = brr(z, 1) & "," & brr(z, 2)
- If d1.exists(ss) Then
- brr(z, 7) = d1(ss)(0): brr(z, 9) = d1(ss)(1)
- clid = d1(ss)(2)
- If clid = 43 Then
- brr(z, 8) = "调仓"
- ElseIf clid = 6 Then
- brr(z, 8) = "call 料"
- ElseIf clid = -4142 Then
- brr(z, 8) = "仓库库存更换"
- End If
- Else
- brr(z, 8) = ""
- End If
- For j = 2 To UBound(drr)
- If brr(z, 1) = drr(j, 2) And brr(z, 2) = drr(j, 5) And brr(z, 3) = drr(j, 7) Then
- brr(z, 12) = "Pass"
- End If
- Next j
- If d2.exists(brr(z, 1) & "," & brr(z, 2)) Then
- brr(z, 13) = "Pass"
- Else
- brr(z, 13) = "Fail"
- End If
- Next z
- Sheets("坏件记录").[a2].Resize(UBound(brr), UBound(brr, 2)) = brr
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|