Help us understand the problem. What is going on with this article?

エクセルで重複している値を持っている行を削除する

More than 3 years have passed since last update.

エクセルの表である一列内にある値が重複していて、その重複している値を持っている行を削除するマクロです。
備忘録で投稿しておきます。

Sub Macro2()

Dim a As String
Dim i As Integer
Dim t As Integer

ActiveCell.Select
a = ActiveCell.Value
ActiveCell.Offset(1, 0).Select

Application.ScreenUpdating = False

For i = 1 To 4141
Debug.Print "a:" & a & "| count:" & i

If a = ActiveCell.Value Then
    Selection.EntireRow.Delete

    For t = 1 To 10000 '一応処理のために時間を置いておく
    Next t

    Else
    ActiveCell.Offset(1, 0).Select
    a = ActiveCell.Value
End If

Next

End Sub
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away