Delete Content In Next Row Cells If Duplicated

  • I am looking to be able to have Excel delete duplicate cells from the next 2 rows after i have pasted in data.


    I have a spreadsheet that 3 rows of data about a race. When I paste the whole list of races into the spreadsheet, I have to go and manually delete the duplicated race time and event location, before other calculations on the spreadsheet can work properly. Is there an If statement i can put in a cell for instance, that will check the cell above for duplicate data and then empty the cell if it is. Or is there a more efficient way to do that with VB, with only selected rows of data please? I can be pasting 60+ lines in a day, and deleting this extra data manually is inefficient.


    This is currently how the data looks when I paste the race data into the appropriate columns in a single paste.


    314:00BangBeat The Tide
    314:00BangTheatrical Style
    314:00BangWhat A Scorcher
    314:20WolvThataboy
    314:20WolvBush Warrior
    314:20WolvPoint North



    As the duplicate lines are deleted it allows other data to change on the spreadsheet.


    This is how I want it to automatically look after pasting the data in.


    114:00BangBeat The Tide
    2Theatrical Style
    3What A Scorcher
    114:20WolvThataboy
    2Bush Warrior
    3Point North


    As you can see, the number to the left, (as well as other things not shown here) change automatically.


    I just can't figure out how to do an If statement for this for each cell.


    Thanks for your help in advance.

  • Re: Delete Content In Next Row Cells If Duplicated


    Thanks.
    That appears to do what I wanted, however, it would appear that I have to have the data pasted into a separate set of columns for that to work. Is that is correct? Because that makes things far more complicated if I have to do that. How do I get that if statement to work on the cells I am pasting data into please?

  • Re: Delete Content In Next Row Cells If Duplicated


    Ok, thanks for your help so far. Part of your code helped me with something else.


    Do you know what would the VBA code for doing this would be please?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!