- ©«¤l
- 522
- ¥DÃD
- 36
- ºëµØ
- 1
- ¿n¤À
- 603
- ÂI¦W
- 0
- §@·~¨t²Î
- win xp sp3
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-12-13
- ³Ì«áµn¿ý
- 2021-7-11
|
¦^´_ 6# abi
³o»ò¤[¤F, °ÝÃDÀ³¸Ó¦´N¸Ñ¨M¤F,
§Ú¥u¬O¯Â½m¥\, ¶¶«KÁÈÂI¼Æ, ½Ð¤£n¤¶·N, ¨Ã½Ð«ü±Ð.- Option Base 1
- Option Explicit
- Private Sub CommandButton1_Click()
- Dim i, startL, ¬ö¿ý¼Æ As Integer
-
- ¬ö¿ý¼Æ = [A1].End(xlDown).Row - 1
-
- '(1) «ö 1¦~¯Å¡B2¯Z¯Å¡B3©m¦W »¼¼W±Æ§Ç
- '[A1].Resize(¬ö¿ý¼Æ + 1, 14).Sort _
- Key1:=Range("A1"), Order1:=xlAscending, _
- Key2:=Range("B1"), Order1:=xlAscending, _
- Key3:=Range("D1"), Order1:=xlAscending, _
- Header:=xlYes
-
- '(2) ¥Dµ{¦¡
- i = 1
- Do
- i = i + 1
- If Cells(i, 4) = Cells(i + 1, 4) Then
- startL = i
- Do
- i = i + 1
- Loop Until Cells(i, 4) <> Cells(i + 1, 4) Or Cells(i, 1) = ""
-
- '§Q¥Î ½Æ»s¡÷¿ï¾Ü©Ê¶K¤W¡÷Âà¸m ªº¤èªk, ¥i±N ¾î¦C »P ª½Äæ ¤¬Âà
- Cells(startL, 6).Resize(i - startL + 1, 1).Copy
-
- '¤£¯à¶K¦bì³B, n¶K¨ì ©¹¥k¤@®æ
- Cells(startL, 7).PasteSpecial Transpose:=True
- End If
- Loop Until i > ¬ö¿ý¼Æ Or Cells(i, 1) = ""
-
- '(3) ¦] (2) ¤£¯à¶K¦bì³B, n¶K¨ì ©¹¥k¤@®æ, ¬G§R °£§R°£ìÅé«
- [F2].Resize(¬ö¿ý¼Æ + 1, 1).Delete Shift:=xlToLeft
-
- '(4) §R°£ Å髪ºªÅ¥Õ¦C
- For i = ¬ö¿ý¼Æ + 1 To 2 Step -1
- If Cells(i, 6) = "" Then Rows(i).Delete
- Next
- '(5) «ö 1¦~¯Å¡B2¯Z¯Å¡B3®y¸¹ »¼¼W±Æ§Ç
- '[A1].Resize(¬ö¿ý¼Æ + 1, 14).Sort _
- Key1:=Range("A1"), Order1:=xlAscending, _
- Key2:=Range("B1"), Order1:=xlAscending, _
- Key3:=Range("C1"), Order1:=xlAscending, _
- Header:=xlYes
- End Sub
½Æ»s¥N½X |
|