Sub VBA Sample01() '2行目が項目 '1列目が主キー(商品コードなど) '2列目が日付、3列目が時刻、4列目~BF列までが各項目 Dim Wsht1 As Worksheet Dim MxRw As Long Dim ix As Long Set Wsht1=Worksheets("Sheet1") MxRw=Wsht1.Range("A65535").End(xlUp).Row Wsht1.Range("A2:BF").Sort _ Key1:=Wsht1.Columns("A"), order1:=xlAscending, _ Key2:=Wsht1.Columns("B"), order2:=xlDescending, _ Key3:=Wsht1.Columns("C"), order3:=xlDescending, _ .Header:=xlYes For ix=MxRw To 3 Step-1 If Wsht1.Cells(ix,1)=Wsht1.Cells(ix-1,1) Then Wsht1.Cells(ix,1).EntireRow.Delete End if Next ix End Sub