Okay, I've attached an example.
Sheet1 contains the master information.
Sheet2 contains the column to find: A1 is the column name, B1 is the column address.
Sheet3 contains the copied information of Sheet1 and needs to be uniquified. All columns other than Column7 can have data, but is left out for readability.
Code:Sub RemoveDups() Dim iRow As Long Dim vCol As Variant Dim iRowEnd As Long vCol = Worksheets("Sheet2").Range("B1").Value With Worksheets("Sheet3").Columns(vCol) iRowEnd = .Cells(.Rows.Count).End(xlUp).Row For iRow = iRowEnd To 2 Step -1 If WorksheetFunction.CountIf(Range(.Cells(1), .Cells(iRow - 1)), .Cells(iRow).Value) > 0 Then .Cells(iRow).EntireRow.Delete End If Next iRow End With End Sub
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Hi, thanks for all your help! It worked!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks