Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am wondering if anyone can help. I have this VB script below tha
deleted duplicates. But I want to know how to make it only look i column F and then delete any dups it finds. Can anyone help, please? Sub DeleteDuplicatesAnyCol() Dim sht As Worksheet, sht2 As Worksheet Dim rng As Range Dim fndrng As Range Dim mycell Dim lookupcol As Integer, i As Integer lookupcol = 1 ' for example Column E - replace with 1 if you want to g with Column A Set sht = ActiveSheet Set rng = sht.Range(sht.Cells(1, lookupcol), sht.Cells(65536 lookupcol).End(xlUp)) Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Set sht2 = Worksheets.Add sht2.Name = "Deleted" i = 1 sht.Activate For Each mycell In rng.Cells Set fndrng = rng.Find(mycell.Value, mycell, xlValues, xlWhole) Do Until fndrng.Row = mycell.Row sht.Rows(fndrng.Row).Copy Destination:=sht2.Rows(i) i = i + 1 sht.Rows(fndrng.Row).Delete Set fndrng = rng.FindNext(mycell) Loop Next mycell Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Su -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
locating and deleting duplicate cell entries | Excel Discussion (Misc queries) | |||
Deleting duplicate entries | Excel Discussion (Misc queries) | |||
Deleting duplicate entries in an Excel list | Excel Worksheet Functions | |||
Deleting duplicate entries in Excel list | Excel Discussion (Misc queries) | |||
Deleting BOTH duplicate entries | Excel Discussion (Misc queries) |