Macro for grouping objects behind object

Hello,
I ask macro to group all objects behind colored  object

Greetings!