Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,066
- Office Version
- 2016
- Platform
- Windows
I have a list of data, it come in a mess and it takes forever to sort out with filters. The data comes like this
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]%John[/TD]
[TD]ADD:1 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD]1 My Address[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]%bob%[/TD]
[TD]ADD: 1 My Address[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]#peter?[/TD]
[TD]ADD: 1 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]ADD: 11 My Address[/TD]
[TD]#Joe[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD]ADDS: 11 My Address[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]peter[/TD]
[TD]#Steve[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]ADDS:10 My Address[/TD]
[TD]#Steve[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need it to Keep All the rows
With "10" then
the rows with 10 + "#"
and then rows with 10,# + "ADD" or "ADDS" in them
The code is to then clears all the other rows and deletes all the BLANK and duplicate rows
Finally, It also needs to sort the names in Column B and Address in Column C. So the end result will look like this
End Result
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]ADD:1 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD]ADD: 11 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Joe[/TD]
[TD]ADD: 11 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Steve[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Steve[/TD]
[TD]ADDS:10 My Address[/TD]
[/TR]
</tbody>[/TABLE]
The code has ignored row with 15 and 5 above as they did not have the number 10 in them even though they had "#" + "ADD"
Can anyone please help.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]%John[/TD]
[TD]ADD:1 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD]1 My Address[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]%bob%[/TD]
[TD]ADD: 1 My Address[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]#peter?[/TD]
[TD]ADD: 1 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]ADD: 11 My Address[/TD]
[TD]#Joe[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD]ADDS: 11 My Address[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]peter[/TD]
[TD]#Steve[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]ADDS:10 My Address[/TD]
[TD]#Steve[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need it to Keep All the rows
With "10" then
the rows with 10 + "#"
and then rows with 10,# + "ADD" or "ADDS" in them
The code is to then clears all the other rows and deletes all the BLANK and duplicate rows
Finally, It also needs to sort the names in Column B and Address in Column C. So the end result will look like this
End Result
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]ADD:1 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Jane[/TD]
[TD]ADD: 11 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Joe[/TD]
[TD]ADD: 11 My Address[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Steve[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]#Steve[/TD]
[TD]ADDS:10 My Address[/TD]
[/TR]
</tbody>[/TABLE]
The code has ignored row with 15 and 5 above as they did not have the number 10 in them even though they had "#" + "ADD"
Can anyone please help.