Removing Duplicate Information in an Excel Table

Interiority

New Member
Joined
Jun 12, 2014
Messages
7
Hi all

I'm trying to write a macro that will remove duplicate data in a table. Essentially, my table looks like this:

Applicant NamePersonal StatementWork HistoryEducation History
Applicant1Applicant1_PSApplicant1_WH1Applicant1_EH1
Applicant1Applicant1_PSApplicant1_WH1Applicant1_EH2
Applicant1Applicant1_PSApplicant1_WH2Applicant1_EH1
Applicant1Applicant1_PSApplicant1_WH2Applicant1_EH2
Applicant2Applicant2_PSApplicant2_WH1Applicant2_EH1
Applicant2Applicant2_PSApplicant2_WH1Applicant2_EH2
Applicant3Applicant3_PSApplicant3_WH1Applicant3_EH1
Applicant3Applicant3_PSApplicant3_WH2Applicant3_EH1
Applicant3Applicant3_PSApplicant3_WH3Applicant3_EH1

<tbody>
</tbody>

















And I want it to look like this:
Applicant NamePersonal StatementWork HistoryEducation History
Applicant1Applicant1_PSApplicant1_WH1Applicant1_EH1
Applicant1_WH2Applicant1_EH2
Applicant2Applicant2_PSApplicant2_WH1Applicant2_EH1
Applicant2_EH2
Applicant3Applicant3_PSApplicant3_WH1Applicant3_EH1
Applicant3_WH2
Applicant3_WH3

<tbody>
</tbody>














....and so on.

Does anyone have any ideas how I can go about doing this? I'm drawing a real blank so far :confused:
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
This might solve your problem.

Sub test()
Dim last_row_add, return_back, last_column


last_column = Range("XFD1").End(xlToLeft).Column + 1
last_row_add = Range("A" & Range("A650000").End(xlUp).Row).Address


Range(last_row_add).Select


Do
If Range(last_row_add).Column <> last_column Then


Do
If ActiveCell.Row <> 2 Then
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.ClearContents
ActiveCell.Offset(-1, 0).Select
Else
ActiveCell.Offset(-1, 0).Select
End If
End If
Loop Until ActiveCell.Row = 2


Range(last_row_add).Offset(0, 1).Select
last_row_add = ActiveCell.Address
End If
Loop Until Range(last_row_add).Column = last_column




End Sub
 
Upvote 0

Forum statistics

Threads
1,216,106
Messages
6,128,863
Members
449,473
Latest member
soumyahalder4

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