VBA example - Excel 2007: loop to rearrange data in cells

VBA code remove duplicate data

In some cases, your current worksheet contains duplicate information that you don't need it. If you have a lot of rows containing duplicate values, you may find it difficult to remove all the duplicate values. This problem can be solved only a few lines of VBA code. In the example text below, there are a few duplicate values(Excel 2007, VBA loop, VBA for Access) that need to be removed.

Some information are duplicate
VBA for Excel
Excel 2007
VBA array
VBA code to delete blank row
VBA loop
Microsoft Excel 2007
VBA looping through Excel sheet
VBA for Access
VBA programming for Excel
VBA example code in Excel
Excel VBA example code
Rearrange information with VBA code
VBA code to hide the blank row
Excel 2007
VBA loop
VBA for Access

To run this example VBA code, you will need a Form, and a CommandButton. You may copy or type the sample text above in to your current worksheet. Note: please select the column that contains the duplicates before pushing the Remove duplicates button.

VBA for Excel: VBA example code to remove duplicate rows

VBA code for this example:

Option Explicit

Private Sub CommandButton1_Click()

    Dim i As Integer
    Selection.RemoveDuplicates (1)

End Sub


    This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
    C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.