BENSON
02-07-2008, 09:19 PM
The code below ( Which i found in this forum ) checkes for and deletes duplicates .It works fine but I see it will only work on the active worksheet.Could some one help me with code so when activated it will check all the worksheets 7 in total .
Thanks
Option Explicit
Sub DeleteDups()
Dim x As Long
Dim LastRow As Long
LastRow = Range("b65536").End(xlUp).Row
For x = LastRow To 1 Step -1
If Application.WorksheetFunction.CountIf(Range("b1:b" & x), Range("b" & x).Value) > 1 Then
Range("b" & x).EntireRow.Delete
End If
Next x
End Sub
Thanks
Option Explicit
Sub DeleteDups()
Dim x As Long
Dim LastRow As Long
LastRow = Range("b65536").End(xlUp).Row
For x = LastRow To 1 Step -1
If Application.WorksheetFunction.CountIf(Range("b1:b" & x), Range("b" & x).Value) > 1 Then
Range("b" & x).EntireRow.Delete
End If
Next x
End Sub