Maybe not so complicated, you can use a Filter on your Activity sheet, then copy over to the Summary in a couple of easy steps.

1) On Activity, select all the values in column D from D5 to the bottom of the data.
2) Select DATA > FILTER > ADVANCED FILTER > Filter in-place > [x] Unique records only....then OK
3) Copy the visible customer codes and paste them into the SUMMARY sheet at A7.
4) Select DATA > FILTER > SHOW ALL to get the regular list back on the ACTIVITY sheet