Do you need code?

But you can do your calculation using commands in Excel's Menu:

1. Sort the column that contains expression using Data>Sort... command so you will have:

1 0:03 EXPR A

4 0:49 EXPR A

7 0:01 EXPR A

3 0:51 EXPR B

2 0:10 EXPR C

5 0:11 EXPR C

6 1:16 EXPR C

2. Using Data > Subtotals... command:

At each change in Expression field, use Sum function and add subtotal to Time field.

3. Now using buttons created in the left of your worksheet you can get the result you want.

Thanks

-FA