Hi!
I need a macro that can find multiple identical values in column A, then find the min and max values of column B and delete all other rows.
Example:
A worker comes to work and registers at 7:55, at 11:00 he registers for lunch and comes back 30min later. At 16:05 he leaves work and all I need is to remove the lunch time for all the days of the month.
Existing table:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]1. jul[/TD]
[TD]07:55[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]11:00[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]11:30[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]16:05[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]07:45[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]11:23[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]11:50[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]16:15[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]07:57[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]11:11[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]11:43[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]16:20[/TD]
[/TR]
</tbody>[/TABLE]
Desired table:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]1. jul[/TD]
[TD]07:55[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]16:05[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]07:45[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]16:15[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]07:57[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]16:20[/TD]
[/TR]
</tbody>[/TABLE]
If there is no lunch registered, than it should just copy the data... I need it to find min and max values of column B, when more than 2 identical values are found in column A.
I searched for an answer, but all I can find is macros that find either min or max, not both.
Can anybody help me with this? It would be much appreciated.
I need a macro that can find multiple identical values in column A, then find the min and max values of column B and delete all other rows.
Example:
A worker comes to work and registers at 7:55, at 11:00 he registers for lunch and comes back 30min later. At 16:05 he leaves work and all I need is to remove the lunch time for all the days of the month.
Existing table:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]1. jul[/TD]
[TD]07:55[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]11:00[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]11:30[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]16:05[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]07:45[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]11:23[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]11:50[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]16:15[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]07:57[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]11:11[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]11:43[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]16:20[/TD]
[/TR]
</tbody>[/TABLE]
Desired table:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]1. jul[/TD]
[TD]07:55[/TD]
[/TR]
[TR]
[TD]1. jul[/TD]
[TD]16:05[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]07:45[/TD]
[/TR]
[TR]
[TD]2. jul[/TD]
[TD]16:15[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]07:57[/TD]
[/TR]
[TR]
[TD]3. jul[/TD]
[TD]16:20[/TD]
[/TR]
</tbody>[/TABLE]
If there is no lunch registered, than it should just copy the data... I need it to find min and max values of column B, when more than 2 identical values are found in column A.
I searched for an answer, but all I can find is macros that find either min or max, not both.
Can anybody help me with this? It would be much appreciated.
Last edited: