PC Review


Reply
Thread Tools Rate Thread

How to deleted duplicate record on columnA

 
 
=?Utf-8?B?TGlsbGlhbg==?=
Guest
Posts: n/a
 
      7th Mar 2007
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 With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      7th Mar 2007
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 With Quote
 
=?Utf-8?B?TGlsbGlhbg==?=
Guest
Posts: n/a
 
      8th Mar 2007
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 With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      8th Mar 2007
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 With Quote
 
=?Utf-8?B?TGlsbGlhbg==?=
Guest
Posts: n/a
 
      8th Mar 2007
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 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
How to delete the duplicate name on columnA =?Utf-8?B?TGlsbGlhbiBMaWFu?= Microsoft Excel Programming 4 27th Aug 2007 09:02 PM
BeforeUpdate - on Duplicate Cancel and Goto Duplicate Record lucy Microsoft Access Form Coding 0 28th Mar 2006 12:44 AM
How do you run a non duplicate query to find non duplicate record =?Utf-8?B?dHJhaW5lcjA3?= Microsoft Access 2 17th Mar 2006 03:07 AM
Adding new numbers as I type without duplicates from Sheet1,ColumnA to Sheet2,ColumnA Master Microsoft Excel Worksheet Functions 2 12th Jul 2005 05:03 PM
Record not being deleted in dbase, even tho the display on datagrid is deleted.. Chumley the Walrus Microsoft Dot NET 2 10th Aug 2004 03:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:11 AM.