ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¯S©w°Ï¶ô¨Ì½s¸¹­«·s±Æ¦C°ÝÃD

¦^´_ 1# lionliu


    play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# lionliu
  1. Sub Sort_Ex()
  2. Dim Rng As Range
  3. Columns("C:C").NumberFormat = "G/³q¥Î®æ¦¡"
  4. rs = Cells(Rows.Count, 5).End(xlUp).Row
  5. r = 2: yn = False: s = 2
  6. Do Until r >= rs
  7. If InStr(Cells(r, 5), "P/O") > 0 Then
  8.    If yn = False Then
  9.       yn = True: x = 1
  10.       Else
  11.       yn = False
  12.       Set Rng = Cells(s + 1, 3).Resize(x - 2, 10)
  13.       k = Application.CountA(Rng.Columns(1))
  14.       If k > 0 Then
  15.       Rng.Columns(1).SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
  16.       Rng = Rng.Value
  17.       Rng.Sort key1:=Rng(1), Header:=xlNo
  18.       End If
  19.       x = 0: s = r: r = r - 1
  20.     End If
  21. End If
  22. r = r + 1: x = x + 1
  23. Loop
  24. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD