Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro
How do I delete duplicates from a column without deleting the row of data
-- Faz |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro
If it is a true duplicate, why would you want to keep the row of data?
Would it not be the same as the duplicate row? If you only want to delete the found range then something like this: Set MyRange = Sheets(1).Range("A2:A100") For i = 100 to 2 Step - 1 'force of habit If Sheets(1).Cells(i, 1) = Sheets(1).Cells(i - 1, 1) Then Sjeets(1).Cells(i, 1).ClearContents End If Next This assumes that the file is sorted on column A so that duplicates are grouped. The problem with this is that now there will be a row of data with nothing in column A that it ties to. This may or may not be significant, depending on the user's data base format and needs. "Faz" wrote in message ... How do I delete duplicates from a column without deleting the row of data -- Faz |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro
This works great..Thanks!!!
-- Faz "JLGWhiz" wrote: If it is a true duplicate, why would you want to keep the row of data? Would it not be the same as the duplicate row? If you only want to delete the found range then something like this: Set MyRange = Sheets(1).Range("A2:A100") For i = 100 to 2 Step - 1 'force of habit If Sheets(1).Cells(i, 1) = Sheets(1).Cells(i - 1, 1) Then Sjeets(1).Cells(i, 1).ClearContents End If Next This assumes that the file is sorted on column A so that duplicates are grouped. The problem with this is that now there will be a row of data with nothing in column A that it ties to. This may or may not be significant, depending on the user's data base format and needs. "Faz" wrote in message ... How do I delete duplicates from a column without deleting the row of data -- Faz |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Avoid Outlook macro security for Excel bades macro | Excel Programming | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
translate lotus 1-2-3 macro into excel macro using excel 2000 | Excel Programming |