+ Reply to Thread
Results 1 to 6 of 6

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

  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...

    Please Login or Register  to view this content.
    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.

  2. #2
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

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

    Sorry - slight amendment - my macro deletes all later versions keeping the oldest - so ideally i need to either copy all data on the row other than timestamp from the latest version to the oldest or need to amend the macro i have to keep only the latest version rather than the oldest (later versions will allways be lower down on the list)

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

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

    Do you have a sample file that you can upload?

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

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

    Hi,

    thanks for the response - i have attached a sample set in the same format - rows E Q and S being the relavant rows - in this example the macro should copy the timestamp for version 1 of trades 1 and 2 on to versions 6 and 4 respectively. Then all versions except 6 and 4 deleted for these duplicated trade numbers.

    Many thanks
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

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

    I have moved my field which requires copying to the end and believe i have sorted it with the following - anybody who sees a glaring error which will hold me up in future - feel free to improve...thanks

    Please Login or Register  to view this content.
    Last edited by arlu1201; 11-26-2012 at 01:48 PM.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

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

    luckylobo,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature below this post.

+ Reply to Thread

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