Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Macro - Cut and paste a row if duplicate

Hello Everybody,

Can anybody help me with a macro which look up A1:F1000 and cut and
paste and then delete the entire row which is a duplicate?

For instance: If data in A1, B1, C1, D1.....F1 is repeating in A5, B5,
C5, D5....F5, delete the entire row (5th row or 1st row based on the
latest date). Date will be given in the column G.

Thanks in advance

-Dileep

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Macro - Cut and paste a row if duplicate

Dileep,

Glad I can finally help someone with something...There is a program
called "Duplicate Master" that will do this for you. See the hyperlink
below...I'm not sure if you are trying to do this for your own
programming self worth or if your just looking to get this done...The
link below will provide you with the end result if your just looking to
get it done...

http://members.iinet.net.au/~brettdj/DM.php

Let me know if this works out... =)

-Todd

On a personal note...This ones for you Tom O. as I can only dream to be
as good as you when it comes to Excel and VB Coding...


Dileep Chandran wrote:
Hello Everybody,

Can anybody help me with a macro which look up A1:F1000 and cut and
paste and then delete the entire row which is a duplicate?

For instance: If data in A1, B1, C1, D1.....F1 is repeating in A5, B5,
C5, D5....F5, delete the entire row (5th row or 1st row based on the
latest date). Date will be given in the column G.

Thanks in advance

-Dileep


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Macro - Cut and paste a row if duplicate


Sorry, I dont want a program. I just need the code.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Macro - Cut and paste a row if duplicate

I found this in VB HELP...Maybe you can alter the code to get it to do
what you want...

This example sorts the data in a column of the worksheet specified and
then deletes rows that contain duplicate data.

Sub DeleteColumnDupes(strSheetName As String, strColumnLetter As
String)
Dim strColumnRange As String
Dim rngCurrentCell As Range
Dim rngNextCell As Range

strColumnRange = strColumnLetter & "1"

Worksheets(strSheetName).Range(strColumnRange).Sor t _
Key1:=Worksheets(strSheetName).Range(strColumnRang e)
Set rngCurrentCell = Worksheets(strSheetName).Range(strColumnRange)
Do While Not IsEmpty(rngCurrentCell)
Set rngNextCell = rngCurrentCell.Offset(1, 0)
If rngNextCell.Value = rngCurrentCell.Value Then
rngCurrentCell.EntireRow.Delete
End If
Set rngCurrentCell = rngNextCell
Loop
End Sub

Dileep Chandran wrote:
Sorry, I dont want a program. I just need the code.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Macro - Cut and paste a row if duplicate

Thanks. But I need to check multiple values. ie not only in one column.
I need to check if name, street address, city and state are repeating.
(C2 to F2).
If all the data in columns C2 to F2 are repeating in the range
B2:F1000, I have to cut and paste the data to another sheet based on
the latest date given in Column G. Means, We have to keep the latest
dates data.

Is my question clear?

Thank you for your help.

-Dileep



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Macro - Cut and paste a row if duplicate

This can be done, but my question to you is what if John Smith moved to a
different address? Neither would be pasted to sheet2. It appears you are not
interested in keeping John Smith's data up to date on sheet2, but keeping
track of how long John Smith has lived at his current address. Is this what
you intend?

Mike F
"Dileep Chandran" wrote in message
ups.com...
Thanks. But I need to check multiple values. ie not only in one column.
I need to check if name, street address, city and state are repeating.
(C2 to F2).
If all the data in columns C2 to F2 are repeating in the range
B2:F1000, I have to cut and paste the data to another sheet based on
the latest date given in Column G. Means, We have to keep the latest
dates data.

Is my question clear?

Thank you for your help.

-Dileep



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
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Excel Programming 1 October 17th 05 08:56 AM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
Cut and Paste using Macro gives paste special method error Lourens Pentz Excel Programming 3 November 21st 04 10:42 PM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 03:36 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"