- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 81
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2025-4-5
               
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-6-21 15:56 ½s¿è
¦^´_ 3# wendy - Sub Ex()
- Dim MySh As Worksheets, Sh As Worksheet, MyId As Range, Ar(), Ay(), Ary(), A As Range
- Dim s%, n&
- Set d = CreateObject("Scripting.Dictionary")
- For Each Sh In Sheets(Array("1", "2", "3", "4"))
- With Sh
- Set MyId = .Cells.Find("«~¸¹", lookat:=xlWhole)
- For Each A In MyId.EntireRow.SpecialCells(xlCellTypeConstants)
- If A <> "Á`p" And d.exists(A.Value) = False Then d(A.Value) = d.Count
- Next
- End With
- Next
- d("Á`p") = d.Count
- With Sheets.Add
- On Error Resume Next
- Application.DisplayAlerts = False
- Sheets("¥Î¶q»Ý¨DÁ`ªí").Delete
- .Name = "¥Î¶q»Ý¨DÁ`ªí"
- .[A1].Resize(, d.Count) = d.keys
- ReDim Ay(0 To d.Count)
- For Each Sh In Sheets(Array("1", "2", "3", "4"))
- ReDim Ar(d.Count)
- With Sh
- Set MyId = .Cells.Find("«~¸¹", lookat:=xlWhole)
- For Each A In MyId.EntireRow.SpecialCells(xlCellTypeConstants)
- Ar(s) = d(A.Value)
- s = s + 1
- Next
- For Each A In .Range(MyId, MyId.End(xlDown))
- If A <> "Á`p" Then
- For i = 0 To d.Count
- If Ar(i) <> "" Then Ay(Ar(i)) = .Cells(A.Row, 1).Offset(, i).Value
- Next
- ReDim Preserve Ary(n)
- Ary(n) = Ay
- n = n + 1
- End If
- ReDim Ay(0 To d.Count)
- Next
- End With
- s = 0
- Next
- .[A1].Resize(n, d.Count) = Application.Transpose(Application.Transpose(Ary))
- .Cells.EntireColumn.AutoFit
- ActiveWindow.Zoom = 75
- End With
- Application.DisplayAlerts = True
- End Sub
½Æ»s¥N½X §â¤Àªí·J¾ã¦¨Á`ªí
¸Õ¸Õ¤£¦Pªº«äºû
±ÄÁʻݨD²Îpªí.rar (71.76 KB)
|
|