|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub zldccmx()
- Dim Arr, Brr, F As Boolean, I&, J&
- Arr = Sheets("取数").[a1:B41]: Brr = Sheets("数据粘贴").[A1:C34]
- For I = 1 To UBound(Arr)
- F = False
- If InStr(Arr(I, 1), "|") Then
- Arr(I, 1) = Split(Split(Split(Arr(I, 1), "- ")(1), "|")(0), "(")(0)
- For J = 1 To UBound(Brr)
- If Arr(I, 1) = Brr(J, 1) Then
- F = True: Exit For
- Else
- F = False
- End If
- Next
- If F Then
- Brr(J, UBound(Brr, 2)) = Arr(I, 2)
- Else
- Sheets("取数").Cells(I, 2).Interior.Color = vbYellow
- End If
- End If
- Next
- Sheets("数据粘贴").[A1:C34] = Brr
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|