• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

very slow filtering

Reggieneo

Member
Hi All,
I have 26 columns rows.
column B to E pertains to ID Number and Work Order respectively.

I need to see that no duplicate combination of these two cells in the rows B and E or else the rows of column B to Z will be deleted.

I have some structure and VBA done but its just taking so much time to complete.
Can somebody please assist me to make this process time shorter.
Appreciate it.

in Column BI7 Formula is = B7 & CHAR(1) & CHAR(1) &E7 to join the criteria
in Column BJ7 Formula is =IF(COUNTIF($BI$7:BI7,BI7)>1,"DUPLICATE","UNIQUE") to check how many times the criteria appears. if its more than one then it will be deleted.

Code:
Dim x As Integer
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ThisWorkbook
Set ws = ThisWorkbook.Sheets("DWS1")
Dim erow
  erow = ThisWorkbook.Sheets("DWS1").Cells(rows.Count, 2).End(xlUp).row
  For x = 7 To erow
  If ws.Cells(x, 62) = "DUPLICATE" Then
  wb.Sheets("DWS1").Range("B" & x & ":Z" & x).ClearContents
End If
Next
 
kind regards,
reggieneo
 
Reggieneo
Could You use Filter to find all 'DUPLICATE's
and after that clear those away?
(= no need to do as now row-by-row)
or
Do You use
Application.ScreenUpdating = False
or
Application.Calculation = xlCalculationManual
before those codes?
 
Use an Advanced Fikter to find unique records
This can be done via Vba
 
Back
Top