Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default exel macro to eliminate duplicate record

It's been quite a few years since I've had to use macros.
But now I'm stuck. I have several large worksheets that
are the result of merged databases and I would like to use
a macro to eliminate duplicate records. This is following
a sort where I can clearly see one row and the one beneath
it has the duplicate data.

Any suggestions please!!!! Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default exel macro to eliminate duplicate record

Sub DeleteDups()
do while ActiveCell < ""
if activeCell.Value = activecell.Offset(1,0).Value then
ActiveCell.Offset(1,0).EntireRow.Delete
else
ActiveCell.Offset(1,0).Select
end if
Loop
End Sub

Select the first cell in the column you want to check and run the macro.

Untested, but should work. Test it on a copy of your workbook.

--
Regards,
Tom Ogilvy

"FSK- in montreal" wrote in message
...
It's been quite a few years since I've had to use macros.
But now I'm stuck. I have several large worksheets that
are the result of merged databases and I would like to use
a macro to eliminate duplicate records. This is following
a sort where I can clearly see one row and the one beneath
it has the duplicate data.

Any suggestions please!!!! Thank you



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default exel macro to eliminate duplicate record

Thanks Tom!!
-----Original Message-----
Sub DeleteDups()
do while ActiveCell < ""
if activeCell.Value = activecell.Offset(1,0).Value

then
ActiveCell.Offset(1,0).EntireRow.Delete
else
ActiveCell.Offset(1,0).Select
end if
Loop
End Sub

Select the first cell in the column you want to check and

run the macro.

Untested, but should work. Test it on a copy of your

workbook.

--
Regards,
Tom Ogilvy

"FSK- in montreal"

wrote in message
...
It's been quite a few years since I've had to use

macros.
But now I'm stuck. I have several large worksheets that
are the result of merged databases and I would like to

use
a macro to eliminate duplicate records. This is

following
a sort where I can clearly see one row and the one

beneath
it has the duplicate data.

Any suggestions please!!!! Thank you



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default exel macro to eliminate duplicate record

There's really no need to make cells active this way - unless you like to
see the screen updating.

Sub Delete_Row()

Dim target as range
set target = activecell
Do

If Target.Value = Target.Offset(1, 0).Value Then
Target.Offset(1, 0).EntireRow.Delete
Else

Ste target = target.Offset(1, 0)
End If

Loop While target.value< ""

End Sub




--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
I Feel Great!
---------------------------------
"Soo Cheon Jheong" wrote in message
...
Try

Sub Delete_Row()

Do

If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
ActiveCell.Offset(1, 0).EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If

Loop While ActiveCell < ""

End Sub

__





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
Eliminate Duplicate Row Chip Excel Discussion (Misc queries) 1 September 25th 09 09:18 PM
how to eliminate duplicate numbers OPer Excel Worksheet Functions 5 September 11th 09 10:29 PM
Eliminate duplicate values in drop down list irvine79 Excel Discussion (Misc queries) 1 February 3rd 09 09:30 PM
Eliminate Duplicate Rows - Add columns Accordingly meendar Excel Discussion (Misc queries) 1 April 11th 06 05:15 PM
How to eliminate duplicate entries Tara Keane Excel Discussion (Misc queries) 4 March 2nd 05 05:33 PM


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

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"