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
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: