Need to remove duplicate slab on laye if they have the same pipe of DDNAME

On laye,  have many slabs which have the same attribute pipe of DDName. I need a small macro to remove duplicates the slab if they have same attribute pipe of DDName instead of deleting manually one by one. Hope you can help me.