Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Evaluate duplicate rows and delete information in specified column

'Removed Duplicates in Column A
Dim rng As Range
Dim i As Integer
Set rng = Range(Cells(1, 1), Cells(1, 1).End(xlDown))
For i = rng.Rows(rng.Rows.Count).Row To rng.Row + 1 Step -1
If Cells(i, "A").Value = Cells(i - 1, "A") and _
Cells(i, "C").Value = Cells(i - 1, "C") and _
Cells(i, "F").Value = Cells(i - 1, "F") and _
Cells(i, "G").Value = Cells(i - 1, "G") Then

Cells(i, "F").ClearContents
Cells(i, "G").ClearContents
Cells(i, "H").ClearContents
Cells(i, "I").ClearContents

'or this
'Range("F" & i & ":i" & i).ClearContents

End If
Next

End Sub



"S Himmelrich" wrote:

The following code works for only Column A:

'Removed Duplicates in Column A
Dim rng As Range
Dim i As Integer
Set rng = Range(Cells(1, 1), Cells(1, 1).End(xlDown))
For i = rng.Rows(rng.Rows.Count).Row To rng.Row + 1 Step -1
If Cells(i, 1).Value = Cells(i - 1, 1) Then
Cells(i, 1).ClearContents
End If
Next

End Sub

I need similar results, but evaluating four columns for duplicate
rows: Columns A, C, F & G, and deleting values in Column F, G, H & I
if condition is true. Can anyone help?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete duplicate records from both columns cantab65 Excel Discussion (Misc queries) 2 March 19th 10 06:15 PM
Delete rows with duplicate information Ixtreme Excel Programming 4 August 18th 07 09:44 AM
filtering out rows with duplicate information rfIPS Excel Discussion (Misc queries) 1 March 6th 07 07:51 PM
merging information from partial duplicate rows Todd Excel Discussion (Misc queries) 3 August 25th 06 10:02 PM
Delete Columns with duplicate headers Casey[_98_] Excel Programming 0 June 2nd 06 07:13 PM


All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"