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

[µo°Ý] §Ú·Q­n°µsheetªºÄæ¦ì°µ±Æ§Ç¨Ã§R°£­«ÂЪº¦C

¦^´_ 1# kasl
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim i As Integer, Rng As Range
  4.     With ActiveSheet  'Sheets("sheet1")
  5.         .UsedRange.Sort Key1:=.Range("A2"), Order1:=xlAscending, Key2:=.Range( _
  6.         "E2"), Order2:=xlAscending, Header:=xlYes
  7.         i = 2
  8.         Do While .Cells(i, "E") <> ""
  9.             If .Cells(i, "b") & .Cells(i, "E") = .Cells(i + 1, "b") & .Cells(i + 1, "E") Then
  10.                 If Rng Is Nothing Then
  11.                     Set Rng = .Cells(i, "E").Offset(1)
  12.                 Else
  13.                     Set Rng = Union(Rng, .Cells(i, "E").Offset(1))
  14.                 End If
  15.             End If
  16.             i = i + 1
  17.         Loop
  18.         If Not Rng Is Nothing Then
  19.             Rng.EntireRow.Delete
  20.             .UsedRange.Sort Key1:=.Range("C2"), Order1:=xlAscending, Key2:=.Range( _
  21.             "A2"), Order2:=xlAscending, Header:=xlYes
  22.         End If
  23.     End With
  24. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 3# kasl
  1. Option Explicit
  2. Sub Ex()
  3.     Dim i As Integer, Rng As Range
  4.     With ActiveSheet  'Sheets("sheet1")
  5.         .UsedRange.Sort Key1:=.Range("A2"), Order1:=xlAscending, Key2:=.Range( _
  6.         "E2"), Order2:=xlAscending, Header:=xlYes
  7.         i = 2
  8.         Do While .Cells(i, "E") <> ""
  9.             If .Cells(i, "b") = .Cells(i + 1, "b") Then '·í¤é»P¤U¤@¤é ­ÓªÑ¦WºÙ¤@¼Ë
  10.                 If .Cells(i, "E") = .Cells(i + 1, "E") Or .Cells(i, "E") > .Cells(i + 1, "C") Then
  11.                   '.Cells(i, "E") = .Cells(i + 1, "E")-> ¥X³õ¤é¤@¼Ë
  12.                   '.Cells(i, "E") > .Cells(i + 1, "C")-> ·í¤é¶i³õÁÙ¨S¥X³õ ¤U¤@µ§´N¶i³õ
  13.                     If Rng Is Nothing Then
  14.                         Set Rng = .Cells(i, "E").Offset(1)
  15.                     Else
  16.                         Set Rng = Union(Rng, .Cells(i, "E").Offset(1))
  17.                     End If
  18.                 End If
  19.             End If
  20.             i = i + 1
  21.         Loop
  22.         If Not Rng Is Nothing Then
  23.             Rng.EntireRow.Delete
  24.             .UsedRange.Sort Key1:=.Range("C2"), Order1:=xlAscending, Key2:=.Range( _
  25.             "A2"), Order2:=xlAscending, Header:=xlYes
  26.         End If
  27.     End With
  28. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : §g¤l¦p¤ô¡AÀH¤è´N¶ê¡AµL³B¤£¦Û¦b¡C
ªð¦^¦Cªí ¤W¤@¥DÃD