°õ¦æVBA¤Wªº°ÝÃD(sorting¤£§¹¥þ)
- ©«¤l
- 40
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 69
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- office07
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-4-24
- ³Ì«áµn¿ý
- 2012-8-20
|
°õ¦æVBA¤Wªº°ÝÃD(sorting¤£§¹¥þ)
°ÝÃD: °õ¦æ®Ésorting¤£§¹¥þ...¥²¶·«ö«Ü¦h¦¸°õ¦æ¤~±Æ§Ç§¹¦¨¡C ÅÞ¿è¤W»yªk¤W³£Àˬd¹L3«K¤F¡AÀ³¸Ó¬O¨S°ÝÃD! ©Ò¥H²{¦b§Ú¤£ª¾¹D¬O¤°»ò°ÝÃD...¥H©¹¨S¼g¹LVBA¹J¨ì³oºØ°ÝÃD..©Ò¥H¤W¨Ó¶Qª©¨D±Ï
¤pªº¦b¤U§Ú¤µ¤Ñ¼g¤F¤@Ó¤psorting ±Æ§Ç¤Tµ§¸ê®Æ 5 4 3 2 1
5 4 3 2 1
5 4 3 2 1
¥Ñ¤p±Æ¨ì¤j¦b¬Y¨Ç¯S©wcell¤¤(¤]´N¬O쥻ªº15Ó®æ¤l)¡A ¥H¤U¬O§Úªºµ{¦¡½X¡A
Sub sorting_order()
Dim temp As Integer
For i = 2 To 4
For j = 7 To 10
If (Worksheets("Sheet1").Cells(i, j).Value > Worksheets("Sheet1").Cells(i, j + 1).Value) Then
temp = Worksheets("Sheet1").Cells(i, j + 1).Value
Worksheets("Sheet1").Cells(i, j + 1).Value = Worksheets("Sheet1").Cells(i, j).Value
Worksheets("Sheet1").Cells(i, j).Value = temp
End If
Next
Next
End Sub
³o¥u¬O¤p¤pªº¤Tµ§±Æ§Ç´ú¸Õ¡A ¦]¬°§Ú»Ýn´X¤dµ§ªº±Æ§Ç Y«ö§¹°õ¦æ¤£ª¾¦ó®É¥i§¹¾ã§¹¦¨±Æ§Ç«h·|µL¸Ñ= =¡C
½Ð¶Q¤H°ª©ï¶Q¤â¡AÁÂÁ¡C |
|
|
|
|
|
|
- ©«¤l
- 40
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 69
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- office07
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-4-24
- ³Ì«áµn¿ý
- 2012-8-20
|
¦^´_ 2# register313
«D±`ÁÂÁ¡A§Ú¯àÀ³¥Î¦bÃe¤jªº¼Æ¶q¤¤¤F! |
|
|
|
|
|
|
- ©«¤l
- 40
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 69
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- office07
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-4-24
- ³Ì«áµn¿ý
- 2012-8-20
|
¦^´_ 2# register313
ÁÂÁÂR¤jªº·N¨£¡A§Úè¸Õrun¤F±zªºµ{¦¡µo²{¥i¥H¶]¡A¸ò§Ú¤§«e°²³]ªºEXCEL½sĶ°ÝÃDµLÃö
¥i¥H³Â·Ð§A¼gÂIµù°O¶Ü? ±zªºµ{¦¡ÆZºë²ªº§Ú¬Ý¤£À´ ^^" |
|
|
|
|
|
|
- ©«¤l
- 40
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 69
- ÂI¦W
- 0
- §@·~¨t²Î
- w7
- ³nÅ骩¥»
- office07
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-4-24
- ³Ì«áµn¿ý
- 2012-8-20
|
¦^´_ 3# GBKEE
ÁÂÁª©¤jªº·N¨£¡A |
|
|
|
|
|
|
- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# m09903020 - Option Explicit
- Sub sorting_order()
- Dim temp As Integer, i As Integer, y As Integer, j As Integer
- For i = 2 To 4
- For y = 7 To 9 '***** ¦³¦³4Äæ n¶]3 ¦¸ ****
- For j = 7 To 9 '쥻¦³4Äæ ²Ä4Ä椣¥²¶]
- 'For j = 7 To 10
- If (Worksheets("Sheet1").Cells(i, j).Value > Worksheets("Sheet1").Cells(i, j + 1).Value) Then
- 'If j < 10 Then
- temp = Worksheets("Sheet1").Cells(i, j + 1).Value
- Worksheets("Sheet1").Cells(i, j + 1).Value = Worksheets("Sheet1").Cells(i, j).Value
- Worksheets("Sheet1").Cells(i, j).Value = temp
- 'End If
- End If
- Next
- Next
- Next
- End Sub
- Sub Ex()
- Dim temp As Integer, i As Integer, y As Integer, j As Integer, Ar
- For i = 2 To 4
- Ar = Application.Transpose(Application.Transpose(Range(Cells(i, 7), Cells(i, 10)).Value))
- '±N ¾ã¦Cªº¼ÆÈÂà¦Ü¦AÂà¦Ü(¬°¤@ºû°}¦C) ¾É¤J °}¦C
- '¤u§@ªí¨ç¼Æ Small ¥i¦b¤@ºû°}¦C¤¤¶Ç¦^ «ü©w±Æ§Ç²Ä´XÓªº ³Ì¤pÈ
- For y = 7 To 10
- Cells(i, y) = Application.Small(Ar, y - 6) '±N °}¦C ȥѳ̤p¶}©l±Æ¦C
- Next
- Next
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 967
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 1001
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN XP
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-11-29
- ³Ì«áµn¿ý
- 2022-5-17
|
¥»©«³Ì«á¥Ñ register313 ©ó 2012-4-24 21:30 ½s¿è
¦^´_ 1# m09903020 - Sub sorting_order()
- C = [G2].End(xlToRight).Column - [G2].Column + 1
- For Each G In Range([G2], [G2].End(xlDown))
- G.Resize(1, C).Sort Key1:=G, Order1:=xlAscending, Header:=xlGuess, Orientation:=xlLeftToRight
- Next
- End Sub
½Æ»s¥N½X- Sub sorting_order()
- C = [G2].End(xlToRight).Column - [G2].Column + 1
- 'C=G2¦V¥k³Ì«á¤@Ä椧Ä渹-G2Ä渹+1=11-7+1=5Äæ
- For Each G In Range([G2], [G2].End(xlDown))
- '°j°é:¦@¦³´X¦Cn±Æ§Ç ²Ä1°é:G=G2,²Ä2°é:G=G3...
- G.Resize(1, C).Sort Key1:=G, Order1:=xlAscending, Header:=xlGuess, Orientation:=xlLeftToRight
- 'G2ÂX¤j5Äæ§@±Æ§Ç ±Æ§ÇÁäG2 »¼¼W±Æ§Ç µL¼ÐÃD ¨Ì¦C±Æ§Ç
- 'G3ÂX¤j5Äæ§@±Æ§Ç ±Æ§ÇÁäG3 »¼¼W±Æ§Ç µL¼ÐÃD ¨Ì¦C±Æ§Ç
- Next
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|