Match multiple columns and retain the latest updated along with next related rows

praveenpatel421983

New Member
Joined
Aug 17, 2017
Messages
41
Hi,
Just to let you guys know my knowledge on excel vba is average. I have always used this forum for help when required and it has been great help!
Now I am stuck with this. Please help!

My excel has many more than 25 columns. I am trying to demonstrate using 4 columns here.

1st column = File Name
2nd column = Revision
3rd column = Date of revision
4th column = Places it is sent (This can be happen in many places and hence can be more than 1 row)

* First it has to check first column and see the string in duplicated or not.
* If duplicated then check second column and find the latest revision of the file.
* If latest revision is found at only one place then retain the latest revision and delete the other versions of the file details along with next rows belonging to that
* If latest revision is duplicated then find the latest date of revision.
* If latest date of revision is found at only one place then retain the latest date of revision and delete the other versions of the file details along with next rows belonging to that.
* If latest date of revision is duplicated then retain any one of them.

I have tried adding for loops and if statement but it is becoming too long and also not deleting the right one. The program failed totally. I have been trying from 2 days and didnt find the right solution. Thats why I am here. Please help.

[TABLE="width: 366"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]File name[/TD]
[TD]Revision of File[/TD]
[TD]Date of Revision[/TD]
[TD]Place[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]D[/TD]
[TD]12-01-2018[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]yy[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]zz[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD][/TD]
[TD]12-01-2018[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]yy[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]zz[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]D[/TD]
[TD]12-01-2018[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]yy[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]zz[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD][/TD]
[TD]11-01-2018[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]yy[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]zz[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD][/TD]
[TD]12-01-2018[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]yy[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]zz[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]D[/TD]
[TD]11-01-2018[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]yy[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]zz[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]B[/TD]
[TD]10-01-2018[/TD]
[TD]xx[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]yy[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]zz[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance!
Praveen
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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