Results 1 to 6 of 6

Copy data from once cell on to rows with a duplicate value

Threaded View

luckylobo Copy data from once cell on... 11-26-2012, 06:50 AM
luckylobo Re: Copy data from once cell... 11-26-2012, 07:10 AM
arlu1201 Re: Copy data from once cell... 11-26-2012, 07:43 AM
luckylobo Re: Copy data from once cell... 11-26-2012, 08:58 AM
luckylobo Re: Copy data from once cell... 11-26-2012, 12:13 PM
arlu1201 Re: Copy data from once cell... 11-26-2012, 01:49 PM
  1. #1
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Copy data from once cell on to rows with a duplicate value

    Hi guys,

    Apologies if the following explanation is a bit dodgy - first post...

    Essentially I have a load of data, Column E has a timestamp, column Q a contract version number and column S a contract number.

    If a trade has been amended there will be 2 rows with the same contract number but a later version no and a different timestamp. I am looking to copy the timestamp from version 1 on to the latest version no. and then delete all previous versions.

    So far I have the following which keeps only the most recent version, but need to somehow copy the timestamp in row E on to all duplicates (or just the most recent) before erasing the previous versions...

    Sub DeletDuplicate()
        Dim x As Long
        Dim LastRow As Long
        LastRow = Range("S65536").End(xlUp).Row
        For x = LastRow To 1 Step -1
            If Application.WorksheetFunction.CountIf(Range("S1:S" & x), Range("S" & x).Text) > 1 Then
                Range("S" & x).EntireRow.Delete
            End If
        Next x
    End Sub
    Any help is greatly appreciated.

    Thanks

    Moderator's Note: Welcome to the forum. You have to put code tags around codes. Select the code then hit the "#" sign. I'll do it for you now. Thank you.
    Last edited by vlady; 11-26-2012 at 07:12 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1