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

[µo°Ý] ½Ð¦U¦ì°ª¤â½ç±Ð,¦p¦ó¥i¥H¼g±o²µu¨Ç

[µo°Ý] ½Ð¦U¦ì°ª¤â½ç±Ð,¦p¦ó¥i¥H¼g±o²µu¨Ç

½Ð¦U¦ì°ª¤â½ç±Ð,µ{¦¡¦p¤U
  1. Sub sort_weight()
  2. '
  3. ' sort_weight Macro
  4. '

  5. '
  6.     Range("C2:E2").Select
  7.     Range(Selection, Selection.End(xlDown)).Select
  8.     Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
  9.         Formula1:="=300.1"
  10.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  11.     With Selection.FormatConditions(1).Font
  12.         .Color = -16383844
  13.         .TintAndShade = 0
  14.     End With
  15.     With Selection.FormatConditions(1).Interior
  16.         .PatternColorIndex = xlAutomatic
  17.         .Color = 13551615
  18.         .TintAndShade = 0
  19.     End With
  20.     Selection.FormatConditions(1).StopIfTrue = False
  21.     Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
  22.         Formula1:="=180.1", Formula2:="=300"
  23.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  24.     With Selection.FormatConditions(1).Font
  25.         .Color = -16752384
  26.         .TintAndShade = 0
  27.     End With
  28.     With Selection.FormatConditions(1).Interior
  29.         .PatternColorIndex = xlAutomatic
  30.         .Color = 13561798
  31.         .TintAndShade = 0
  32.     End With
  33.     Selection.FormatConditions(1).StopIfTrue = False
  34.     Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
  35.         Formula1:="=120.1", Formula2:="=180"
  36.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  37.     With Selection.FormatConditions(1).Font
  38.         .Color = -16751204
  39.         .TintAndShade = 0
  40.     End With
  41.     With Selection.FormatConditions(1).Interior
  42.         .PatternColorIndex = xlAutomatic
  43.         .Color = 10284031
  44.         .TintAndShade = 0
  45.     End With
  46.     Selection.FormatConditions(1).StopIfTrue = False
  47.     Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
  48.         Formula1:="=2", Formula2:="=3"
  49.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  50.     With Selection.FormatConditions(1).Font
  51.         .Color = -16752384
  52.         .TintAndShade = 0
  53.     End With
  54.     With Selection.FormatConditions(1).Interior
  55.         .PatternColorIndex = xlAutomatic
  56.         .Color = 13561798
  57.         .TintAndShade = 0
  58.     End With
  59.     Selection.FormatConditions(1).StopIfTrue = False
  60.     Range("D2").Select
  61.     Range(Selection, Selection.End(xlDown)).Select
  62.     ActiveWorkbook.Worksheets("shipment detail").Sort.SortFields.Clear
  63.     ActiveWorkbook.Worksheets("shipment detail").Sort.SortFields.Add Key:=Range( _
  64.         "D2"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
  65.         xlSortNormal
  66.     With ActiveWorkbook.Worksheets("shipment detail").Sort
  67.         .SetRange Range("A2:Q41")
  68.         .Header = xlNo
  69.         .MatchCase = False
  70.         .Orientation = xlTopToBottom
  71.         .SortMethod = xlPinYin
  72.         .Apply
  73.     End With
  74.     Range("F2").Select
  75.     Range(Selection, Selection.End(xlToRight)).Select
  76.     Range(Selection, Selection.End(xlDown)).Select
  77.     [color=Red]Selection.FormatConditions.Add Type:=xlTextString, String:="NET-A-PORTER", _
  78.         TextOperator:=xlContains
  79.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  80.     With Selection.FormatConditions(1).Font
  81.         .Color = -16383844
  82.         .TintAndShade = 0
  83.     End With
  84.     With Selection.FormatConditions(1).Interior
  85.         .PatternColorIndex = xlAutomatic
  86.         .Color = 13551615
  87.         .TintAndShade = 0
  88.     End With
  89.     Selection.FormatConditions(1).StopIfTrue = False
  90.     Selection.FormatConditions.Add Type:=xlTextString, String:="NET A PORTER", _
  91.         TextOperator:=xlContains
  92.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  93.     With Selection.FormatConditions(1).Font
  94.         .Color = -16383844
  95.         .TintAndShade = 0
  96.     End With
  97.     With Selection.FormatConditions(1).Interior
  98.         .PatternColorIndex = xlAutomatic
  99.         .Color = 13551615
  100.         .TintAndShade = 0
  101.     End With
  102.     Selection.FormatConditions(1).StopIfTrue = False
  103.     Selection.FormatConditions.Add Type:=xlTextString, String:="INTERLINK", _
  104.         TextOperator:=xlContains
  105.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  106.     With Selection.FormatConditions(1).Font
  107.         .Color = -16383844
  108.         .TintAndShade = 0
  109.     End With
  110.     With Selection.FormatConditions(1).Interior
  111.         .PatternColorIndex = xlAutomatic
  112.         .Color = 13551615
  113.         .TintAndShade = 0
  114.     End With
  115.     Selection.FormatConditions(1).StopIfTrue = False
  116.     Selection.FormatConditions.Add Type:=xlTextString, String:="39 TSING YI", _
  117.         TextOperator:=xlContains
  118.     Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
  119.     With Selection.FormatConditions(1).Font
  120.         .Color = -16383844
  121.         .TintAndShade = 0
  122.     End With
  123.     With Selection.FormatConditions(1).Interior
  124.         .PatternColorIndex = xlAutomatic
  125.         .Color = 13551615
  126.         .TintAndShade = 0
  127.     End With
  128.     Selection.FormatConditions(1).StopIfTrue = False[/color]End Sub
½Æ»s¥N½X
½Ð¦U¦ì¤j¤jÀ°¦£¸Ñ´b¡A·PÁ¡I

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD