removing duplicate rows in excel using vba based on constraints

satya rajesh

New Member
Joined
Jan 9, 2015
Messages
3
Hi
I have a requirement where the duplicate rows has to be removed from a range of columns.
Example input:
RowNo emplid firstname phonetype phonenum rownumber deptid deptname joindate rownumber
1 1001 abc home 88888 1 551 cse 10/10/2010 1
2 1001 abc home 88888 2 552 ece 10/11/2011 2
3 1002 pqr mobile 99999 3 223 civil 14/1/2013 3

Output:

RowNo emplid firstname phonetype phonenum rownumber deptid deptname joindate rownumber
1 1001 abc home 88888 1 551 cse 10/10/2010 1
2 2 552 ece 10/11/2011 2
3 1002 pqr mobile 99999 3 223 civil 14/1/2013 3

As shown in the above output the second row containing the duplicate values between the first row number and the second rownumber column have to be deleted.
The solution should span over all the row number columns that gets repeated and remove the duplicates accordingly.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top