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

[µo°Ý] ¨Ï¥ÎVBA¿z¿ï/¦Û­q²M³æ(CustomOrder)ªºAddCustomListªº¸ê®Æ¬O§_¥i¥HªÅ¥Õ

[µo°Ý] ¨Ï¥ÎVBA¿z¿ï/¦Û­q²M³æ(CustomOrder)ªºAddCustomListªº¸ê®Æ¬O§_¥i¥HªÅ¥Õ

¥»©«³Ì«á¥Ñ av8d ©ó 2022-11-6 22:48 ½s¿è

¥H¤U¬°¥¨¶°¦Û°Ê¼¶¼g¡Aºô¸ô¤W¦Û¦æª¦¤å­×§ï«áªºµ²ªG
n = Application.CustomListCount
     Application.AddCustomList (Worksheets("¤u§@ªí2").Range("a2:a3"))

a2:a3¡A¹w­p·|¦³«Ü¦h¡A¦ý¬O·í§Ú§ï¼g¦¨a2:a4®É·|¥X¿ù¡C(a4¬OªÅ¥Õ)
  1.     Range("G2").Select
  2.     Selection.CurrentRegion.Select
  3.     ActiveWorkbook.Worksheets("¤u§@ªí2").Sort.SortFields.Clear
  4.     n = Application.CustomListCount
  5.      Application.AddCustomList (Worksheets("¤u§@ªí2").Range("a2:a3"))
  6.     ActiveWorkbook.Worksheets("¤u§@ªí2").Sort.SortFields.Add Key:=Range("G2:G58"), _
  7.         SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:= _
  8.         n + 1, DataOption:=xlSortNormal
  9.     ActiveWorkbook.Worksheets("¤u§@ªí2").Sort.SortFields.Add Key:=Range("H2:H58"), _
  10.         SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
  11.     With ActiveWorkbook.Worksheets("¤u§@ªí2").Sort
  12.         .SetRange Range("G1:K58")
  13.         .Header = xlYes
  14.         .MatchCase = False
  15.         .Orientation = xlTopToBottom
  16.         .SortMethod = xlPinYin
  17.         .Apply
  18.     End With
  19.     [F1].Select
½Æ»s¥N½X

¦^´_ 1# av8d

½Ðªþ¤WÀɮסAÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : ¯u¥¿ªº·R¤ß¡A¬O·ÓÅU¦n¦Û¤vªº³oÁû¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD