Extract codes and quantities of only the components highlighted in the drawing table

Extract codes and quantities of only the components highlighted in the drawing table.

 

Could you tell me if this is possible and how to achieve this?

When I display various views in the drawing board, I'd like something that extracts the codes and their quantities, but only for the components and subassemblies I've highlighted. Essentially, a bill of materials, but only for the materials I've highlighted.