- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# aok669
- Sub Ex()
- Dim D As Object, Sh As Worksheet, R As Range, i%, S$, ii
- Set D = CreateObject("Scripting.Dictionary")
- For Each Sh In Sheets
- If Sh.Name <> "main" Then
- With Sh
- i = .Range("a1").End(xlDown).Row
- For Each R In .Range("A3:A" & i & ",F3:F" & i)
- S = .Name & .Cells(1, R.Column) & R(1, 2)
- D(S) = Array(R(1, 3), R(1, 4), R(1, 5))
- Next
- End With
- End If
- Next
- With Sheets("MAIN")
- i = .Range("a" & Rows.Count).End(xlUp).Row
- For Each R In .Range("A3:A" & i)
- For ii = 4 To 6
- S = .Cells(2, ii) & .[D1] & R
- If D.exists(S) Then
- If R(1, 2) = "" Then R(1, 2) = D(S)(1)
- If R(1, 3) = "" Then R(1, 3) = D(S)(2)
- R(1, ii) = D(S)(0)
- Else
- R(1, ii) = ""
- End If
- Next
- For ii = 9 To 11
- S = .Cells(2, ii) & .[i1] & R
- If D.exists(S) Then
- If R(1, 2) = "" Then R(1, 2) = D(S)(1)
- If R(1, 3) = "" Then R(1, 3) = D(S)(2)
- R(1, ii) = D(S)(0)
- Else
- R(1, ii) = ""
- End If
- Next
- If Application.Sum(R(1, 4).Resize(, 3), R(1, 9).Resize(, 3)) = 0 Then
- R(1, 2) = ""
- R(1, 3) = ""
- End If
- Next
- End With
- End Sub
½Æ»s¥N½X |
|