PC Review


Reply
Thread Tools Rate Thread

clearing duplicate values in Column A

 
 
S Himmelrich
Guest
Posts: n/a
 
      22nd Jan 2008
this solution deletes the row, I only want to clear the duplicate 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).Delete shift:=xlUp
End If
Next
 
Reply With Quote
 
 
 
 
GTVT06
Guest
Posts: n/a
 
      22nd Jan 2008
On Jan 22, 3:58*pm, S Himmelrich <himmelr...@gmail.com> wrote:
> this solution deletes the row, I only want to clear the duplicate 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).Delete shift:=xlUp
> * * End If
> Next

Try this one

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
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
display duplicate values in column =?Utf-8?B?S2lydDg0?= Microsoft Access 8 9th Oct 2006 05:00 PM
Counting of Duplicate Values in a column tahir Microsoft Excel Programming 7 26th Mar 2006 11:57 PM
can i not allow duplicate values in the same column? =?Utf-8?B?ZXhjZWwgbmV3Ymll?= Microsoft Excel New Users 2 20th Jan 2005 07:51 PM
Finding duplicate values in a column =?Utf-8?B?S3lsZWFubmU=?= Microsoft Excel Worksheet Functions 1 26th Oct 2004 07:55 AM
Sum of duplicate values in a column John Young Microsoft Excel Programming 2 18th May 2004 09:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:04 PM.