If you have a multilayer composition and you
want to apply an effect to all the layers at once, don’t flatten the layers–use a composite layer instead. Hide the layers you want excluded, and press Shift-Command-Option-E (PC: Shift-Ctrl-Alt-E). A new layer will be created at the top containing a merged copy of all the visible layers.
Another option is to create a new layer at the top of the stack and make it active. Command-click (PC: Ctrl-click) each layer you want to include to make those layers active, as well. Press Option-Command-E (PC: Alt-Ctrl-E).
by Colin Smith