The ability to isolate and sort analytes within complex microfluidic volumes is essential to the success of lab-on-a-chip (LOC) devices. In this study, acoustically-excited oscillating bubbles are used to selectively trap particles, with the selectivity being a function of both particle size and density. The operating principle is based on the interplay between the strong microstreaming-induced drag force and the attractive secondary Bjerknes force. Depending upon the size of the bubble, and thus its resonant frequency, it is possible to cause one force to dominate over the other, resulting in either particle attraction or repulsion. A theoretical analysis reveals the extent of the contribution of each force for a given particle size; in close agreement with experimental findings. Density-based trapping is also demonstrated, highlighting that denser particles experience a larger secondary Bjerknes force resulting in their attraction. This study showcases the excellent applicability and versatility of using oscillating bubbles as a trapping and sorting mechanism within LOC devices.