|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub test()
- Dim r%, i%
- Dim arr, brr
- With Worksheets("sheet1")
- c = .Cells(1, .Columns.Count).End(xlToLeft).Column
- arr = .Range("b2").Resize(10, c - 1)
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- brr = .Range("a14").Resize(r - 13, 1)
- ReDim crr(1 To UBound(brr), 1 To UBound(arr, 2))
- For i = 1 To UBound(brr)
- xm = Split(brr(i, 1), ",")
- For j = 1 To UBound(arr, 2)
- For q = 0 To UBound(xm)
- If arr(Val(xm(q)), j) = "A" Then
- Exit For
- End If
- Next
- If q > UBound(xm) Then
- crr(i, j) = "NG"
- Else
- crr(i, j) = "YES"
- End If
- Next
- Next
- .Range("b14").Resize(UBound(crr), UBound(crr, 2)) = crr
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|