- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 276
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-22
|
¦^´_ 1# luke - Sub ex()
- Dim Ar(), A As Range, C As Range, B As Range
- Set d = CreateObject("Scripting.Dictionary")
- With sheet2
- For Each A In .Range(.[D2], .[D2].End(xlDown))
- x = A & A.Offset(, 1)
- For Each C In .Range(.[F1], .[F1].End(xlToRight))
- d(x & C) = .Cells(A.Row, C.Column)
- Next
- Next
- End With
- With sheet1
- For Each A In .Range(.[A1], .[A1].End(xlDown))
- Set B = A.Resize(, 4)
- p = IIf(d(B(1) & B(2) & B(3)) = "", Replace(B(2), "X", ""), d(B(1) & B(2) & B(3)))
- n = IIf(d(B(1) & B(2) & B(4)) = "", Replace(B(2), "X", ""), d(B(1) & B(2) & B(4)))
- A.Offset(, 5).Resize(, 4) = Array(B(1), B(2), p, n)
- Next
- End With
- End Sub
½Æ»s¥N½X |
|