- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 280
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-27
|
¦^´_ 4# pitera88
B¤u§@ªí¦³¸ê®Æ´N¼g¤JB¤u§@ªí¡A¨S¦³ªº´N¥HA¤u§@ªí¬°·Ç- Private Sub CommandButton1_Click()
- Dim Sh As Worksheet, A As Range
- Set d = CreateObject("Scripting.Dictionary")
- For Each Sh In Sheets(Array("A", "B"))
- With Sh
- For Each A In .Range(.[B2], .[B2].End(xlDown))
- If IsEmpty(d(A.Value)) Then
- d(A.Value) = Application.Transpose(Application.Transpose(A.Offset(, -1).Resize(, 7).Value))
- Else
- ar = d(A.Value)
- For i = LBound(ar) To UBound(ar)
- If A.Offset(, -1).Resize(, 7).Cells(1, i) <> "" Then ar(i) = A.Offset(, -1).Resize(, 7).Cells(1, i).Value
- d(A.Value) = ar
- Next
- End If
- Next
- End With
- Next
- With Sheets(3)
- .UsedRange.Offset(1).ClearContents
- .[A2].Resize(d.Count, 7).Value = Application.Transpose(Application.Transpose(d.items))
- .[A2].Resize(d.Count, 7).Sort key1:=.Cells(1, 1), Header:=xlNo
- End With
- End Sub
½Æ»s¥N½X |
|