- ©«¤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
|
¦^´_ 1# hamj3113
¤j¤j§A¦n, ¤Ó±ß¤F§a!!
¸Õ¸Õ¬Ý:
Sheet1 CommandButton1 ¤§ VBA code:- '
- Option Explicit
- Private Sub CommandButton1_Click()
- Dim sh1, sh2 As Worksheet
- Dim i, cnt, oldK, newK, blankRow As Integer
- Dim °Ó«~ABC, °Ó«~³¡ªù, °Ó«~¦WºÙ As String
- Set sh1 = Sheets("Sheet1")
- Set sh2 = Sheets("Sheet2")
-
- «ö_°Ó«~³¡ªù_°Ó«~ABC_±Æ
-
- '¨ú±o¥Ø«e¸ê®Æµ§¼Æ
- blankRow = [A65536].End(xlUp).Row
- i = 5
- Do
- oldK = sh2.[IV4].End(xlToLeft).Column + 1
- °Ó«~³¡ªù = sh1.Cells(i, 6)
- Do
- newK = oldK
- °Ó«~ABC = sh1.Cells(i, 5)
-
- '¥» VBA ¥u¦³¦b °Ó«~ABC §¡¬° "A","B","C",...®É, ¤~¯à¥¿±`¹B§@
- '§Q¥Î "A","B","C" ªº ASCII ©w¦ì °Ó«~¦WºÙ ªº¦C¦ì
- cnt = Asc(sh1.Cells(i, 5)) - 60
- Do
- sh2.Cells(4, newK) = °Ó«~³¡ªù
- °Ó«~¦WºÙ = sh1.Cells(i, 3)
- sh2.Cells(cnt, newK) = °Ó«~¦WºÙ
- newK = newK + 1
- i = i + 1
- If sh1.Cells(i, 5) = "" Then GoTo Done1
- Loop Until °Ó«~ABC <> sh1.Cells(i, 5) Or °Ó«~³¡ªù <> sh1.Cells(i, 6)
-
- Loop Until °Ó«~³¡ªù <> sh1.Cells(i, 6)
-
- Loop Until °Ó«~³¡ªù = ""
-
- Done1:
- 'sh1 «ì´_쪬
- «ö_±Æ§Ç_±Æ
- End Sub
½Æ»s¥N½X Module1 ¤§ VBA code- Sub «ö_±Æ§Ç_±Æ()
- Dim sh1 As Worksheet
- Dim blankRow As Integer
- Set sh1 = Sheets("Sheet1")
-
- '¨ú±o¥Ø«e¸ê®Æµ§¼Æ
- blankRow = sh1.[A65536].End(xlUp).Row
-
- sh1.[A4].Resize(blankRow, 7).Sort _
- Key1:=sh1.[A4], Order1:=xlAscending, _
- Header:=xlYes
- End Sub
- Sub «ö_°Ó«~³¡ªù_°Ó«~ABC_±Æ()
- Dim sh1 As Worksheet
- Dim blankRow As Integer
- Set sh1 = Sheets("Sheet1")
-
- '¨ú±o¥Ø«e¸ê®Æµ§¼Æ
- blankRow = sh1.[A65536].End(xlUp).Row
-
- sh1.[A4].Resize(blankRow - 3, 7).Sort _
- Key1:=sh1.[F4], Order1:=xlAscending, _
- Key2:=sh1.[E4], Order2:=xlAscending, _
- Header:=xlYes
- End Sub
½Æ»s¥N½X
|
|