Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default How to deleted duplicate record on columnA

I have big excel record, but on the columnA has a lots of dupluicate record,
how can I write a macro to delete them
ColumnA
aaa
aaa
bbb
bbb
ccc
ccc
I want be like this
ColumnA
aaa
bbb
ccc


Thanks.

Lillian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How to deleted duplicate record on columnA

Sub sonic()
i = Cells(Rows.Count, "A").End(xlUp).Row
For j = i To 2 Step -1
If Cells(j, "A").Value = Cells(j - 1, "A").Value Then
Cells(j, "A").Delete
End If
Next
End Sub

--
Gary''s Student
gsnu200709


"Lillian" wrote:

I have big excel record, but on the columnA has a lots of dupluicate record,
how can I write a macro to delete them
ColumnA
aaa
aaa
bbb
bbb
ccc
ccc
I want be like this
ColumnA
aaa
bbb
ccc


Thanks.

Lillian

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default How to deleted duplicate record on columnA

Gary,

This look good, but only deleted columnA, but actually I would like
deleted entire duplicated record, how did we do that.


Thanks for all the help

Lillian

"Gary''s Student" wrote:

Sub sonic()
i = Cells(Rows.Count, "A").End(xlUp).Row
For j = i To 2 Step -1
If Cells(j, "A").Value = Cells(j - 1, "A").Value Then
Cells(j, "A").Delete
End If
Next
End Sub

--
Gary''s Student
gsnu200709


"Lillian" wrote:

I have big excel record, but on the columnA has a lots of dupluicate record,
how can I write a macro to delete them
ColumnA
aaa
aaa
bbb
bbb
ccc
ccc
I want be like this
ColumnA
aaa
bbb
ccc


Thanks.

Lillian

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How to deleted duplicate record on columnA

Sub sonic()
i = Cells(Rows.Count, "A").End(xlUp).Row
For j = i To 2 Step -1
If Cells(j, "A").Value = Cells(j - 1, "A").Value Then
Cells(j, "A").EntireRow.Delete
End If
Next
End Sub

The one-line change deletes the row instead of just the cell.
--
Gary's Student
gsnu200709


"Lillian" wrote:

Gary,

This look good, but only deleted columnA, but actually I would like
deleted entire duplicated record, how did we do that.


Thanks for all the help

Lillian

"Gary''s Student" wrote:

Sub sonic()
i = Cells(Rows.Count, "A").End(xlUp).Row
For j = i To 2 Step -1
If Cells(j, "A").Value = Cells(j - 1, "A").Value Then
Cells(j, "A").Delete
End If
Next
End Sub

--
Gary''s Student
gsnu200709


"Lillian" wrote:

I have big excel record, but on the columnA has a lots of dupluicate record,
how can I write a macro to delete them
ColumnA
aaa
aaa
bbb
bbb
ccc
ccc
I want be like this
ColumnA
aaa
bbb
ccc


Thanks.

Lillian

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default How to deleted duplicate record on columnA

Thanks Gary, this one work

"Gary''s Student" wrote:

Sub sonic()
i = Cells(Rows.Count, "A").End(xlUp).Row
For j = i To 2 Step -1
If Cells(j, "A").Value = Cells(j - 1, "A").Value Then
Cells(j, "A").EntireRow.Delete
End If
Next
End Sub

The one-line change deletes the row instead of just the cell.
--
Gary's Student
gsnu200709


"Lillian" wrote:

Gary,

This look good, but only deleted columnA, but actually I would like
deleted entire duplicated record, how did we do that.


Thanks for all the help

Lillian

"Gary''s Student" wrote:

Sub sonic()
i = Cells(Rows.Count, "A").End(xlUp).Row
For j = i To 2 Step -1
If Cells(j, "A").Value = Cells(j - 1, "A").Value Then
Cells(j, "A").Delete
End If
Next
End Sub

--
Gary''s Student
gsnu200709


"Lillian" wrote:

I have big excel record, but on the columnA has a lots of dupluicate record,
how can I write a macro to delete them
ColumnA
aaa
aaa
bbb
bbb
ccc
ccc
I want be like this
ColumnA
aaa
bbb
ccc


Thanks.

Lillian

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
Duplicate company name to be deleted mat Excel Discussion (Misc queries) 3 November 20th 06 09:14 PM
Adding new numbers as I type without duplicates from Sheet1,ColumnA to Sheet2,ColumnA Master Excel Worksheet Functions 2 July 12th 05 05:03 PM
Duplicate Record.... sal21[_46_] Excel Programming 1 November 11th 04 08:11 AM
Duplicate Record.... sal21[_44_] Excel Programming 1 November 9th 04 04:24 PM
draw borders around deleted duplicate cells hayk_yer - ExcelForums.com Excel Programming 3 September 3rd 04 08:56 AM


All times are GMT +1. The time now is 08:52 AM.

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

About Us

"It's about Microsoft Excel"