Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

Excel 2010 Copy Duplicates to a new worksheet

Could an expert provide me with VBA to move duplicates please.

I have a spreadsheet that has a header row in row 1

columns go from A to AJ

Number of rows will change

I need to look in column H for any duplicates and wherever I find one I need to move one of the items [complete row] to a new worksheet. [Named Duplicates] I also need the header row from Sheet1 copied onto the sheet named Duplicates.

Many thanks
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

Question:

You say:
I need to look in column H for any duplicates and wherever I find one I need to move one of the items [complete row] to a new worksheet.

This means that only the data in Col H need to be the same to consider the whole row as Duplicate ? or we need to test the whole columns (A to AJ) to see if they are all identical then consider the row as Duplicate ??

gowflow
Avatar of Jagwarman
Jagwarman

ASKER

Hi Gowflow

yes only the data in H needs to be a duplicate and then move the entire row

Regards
Can we sort the worksheet first ?
gowflow
If it has to sorted then yes that would not be a problem
ASKER CERTIFIED SOLUTION
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Robhenson

First line of the question clearly says:

Could an expert provide me with VBA to move duplicates please.


gowflow
Indeed he did!!

Doesn't mean to say that he won't be interested in a non-VBA answer.

Rob H
True was just highlighting the fact.
gowflow
Without wishing to disrespect the question answer, I always assume that if a question is asked specifying that they need VBA; unless it is fairly obviously a repetitive routine that they are trying to automate, then they have unsuccessfully tried other avenues first and are assuming that VBA holds their answer.

My suggestion is that they may not have tried all other avenues.

Likewise in this case an Advanced Filter may work for them, reversing the logic and separating out the Unique values to another sheet.

Thanks
Rob H
or

Unless it is in fact a repettitve routine, which I usually tend to think of at first.

At the end each one sees it from his own perspective whereas I do favor VBA as not too much into formulas ... and presume you are just the opposite !!

Point of views !
gowflow
Gowflow did provide the solution I was looking for but robhenson also provided a solution that works.