- ©«¤l
- 254
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 310
- ÂI¦W
- 0
- §@·~¨t²Î
- W10
- ³nÅ骩¥»
- Excel 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2019-6-16
- ³Ì«áµn¿ý
- 2024-9-23
|
¦^´_ 6# PJChen
¦³ªÅ¦AÀ°§Ú¸Õ¸Õ¬Ý¬O¤£¬O§Anªºµ²ªGÁÂÁÂ- Public Sub ¸ó¤u§@ï¤ñ¹ï¨Ã²¾°Ê½m²ß0409()
- Application.ScreenUpdating = False
- '·s¼W¤@Ó¤u§@ªí±Æ¦C«á ¦s¨ì°}¦C¦b§R°£¤u§@ªí
- Sheets.Copy After:=Sheets(Sheets.Count)
- Range([A65535].End(3), [A4]).Sort [A4], 1, Header:=2
- Set xD = CreateObject("Scripting.Dictionary")
- Arr = Range([A65535].End(3), [A1])
-
- Application.DisplayAlerts = False
- Sheets(Sheets.Count).Delete
- Application.DisplayAlerts = True
- '--------------------------------------------------------
- '§â±Æ¦C«áªº¸ê®Æ¦s¨ì¦r¨å¸Ì
- For X = 1 To UBound(Arr, 1)
- xD(Arr(X, 1)) = Trim(xD(Arr(X, 1)) & " " & X)
- Next X
- Erase Arr
- '--------------------------------------------------------
- '´M§äÀɮתº¦ì¸mµM«á¶}±Ò
- A = Dir(ThisWorkbook.Path & "\" & "*.xlsx")
- Workbooks.Open ThisWorkbook.Path & "\" & A
- '--------------------------------------------------------
- '¤Á´«¨ì«ü©w¤u§@ªí §â§t¦³"®Æ¸¹"ªº¨º¤@Äæ¦ì¸m°O¤U¨Ó
- Sheets("¾ã¤ë²Îp").Activate '³o¸Ì¥i¥H«ü©wn±Æ¦Cªº¤u§@ªíªº¦ì¸m "¾ã¤ë²Îp" ©Î "3"
- Arr = ActiveSheet.UsedRange
- For X = 1 To UBound(Arr, 1)
- For Y = 1 To UBound(Arr, 2)
- If Arr(X, Y) = "®Æ¸¹" Then
- Y = Y
- X = X + 1
- GoTo A01
- End If
- Next Y
- Next X
- A01: Erase Arr
- '--------------------------------------------------------
- '´M§ä¤ñ¹ï«á¨Ã«·s±Æ¦C
- For Each D In xD
- SR = Split(xD(D), " ")
- For Each S In SR
- If D = Empty Then Exit For
- With Range(Cells(1, Y), Cells(Rows.Count, Y).End(3))
- On Error Resume Next
- Set C = .Find(D)
- G = .FindNext(C).Address
- If C = D Then
- If Not C Is Nothing Then
- Rows(C.Row).Cut
- Set C = .FindNext(G)
- K = K + 1
- Rows(X + K).Insert , 1
- End If
- End If
- Application.CutCopyMode = False
- On Error GoTo 0
- End With
- Next S
- Next D
- Set C = Nothing
-
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X
0409.rar (287.7 KB)
|
|