|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub test0() '昨日写完就不见原来已解决灌一下吧
- Dim a, b, c() As String
- Dim i As Long, j As Long, k As Long, s As String
- s = Chr(34)
- a = Range("P2", Range("D2").End(xlDown))
- b = Range("D12:P15")
- ReDim c(1 To UBound(a), 1 To UBound(a, 2) - 1)
- For j = 2 To UBound(b, 2)
- b(1, j) = s & b(1, j) & s
- For i = 2 To UBound(b)
- If Len(b(i, j)) Then b(1, j) = b(1, j) & b(i, j) & s
- Next
- Next
- For j = 2 To UBound(b, 2)
- If Len(Mid(b(1, j), 3)) Then
- k = k + 1
- For i = 1 To UBound(a)
- If InStr(b(1, j), s & a(i, j) & s) = 0 Then c(i, k) = a(i, 1)
- Next
- End If
- Next
- With Range("E19")
- .CurrentRegion.ClearContents
- .Resize(UBound(c), k) = c
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|