Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

clearing duplicate values in Column A

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
S Himmelrich - 22 Jan 2008 21:58 GMT
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
GTVT06 - 22 Jan 2008 22:20 GMT
> this solution deletes the row, I only want to clear the duplicate in
> Column A.
[quoted text clipped - 6 lines]
>     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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.