復制代碼代碼如下: Sub 你的宏名稱() x = ActiveCell.Row Z = ActiveCell.Column Do While Cells(x, Z).Value <> "" y = x + 1 Do While Cells(y, Z).Value <> "" If (Cells(x, Z).Value = Cells(y, Z).Value) Then 'Cells(x, z).Interior.ColorIndex = 3 'Cells(y, z).Interior.ColorIndex = 3 '上面這兩行可以將重復的標為紅色。 Rows(y).Delete End If y = y + 1 Loop x = x + 1 Loop End Sub