If I'm not mistaken the plane will capture the selected altitude (on 737) when climbing or descending in CWS only if the selected mode for AP is CMD,even though you're climbing in CWS Pitch (for ex if you deselected the pitch mode). If the selected mode is CWS ,you'll pass through the selected altitude,as NorthernSky said.
I-2021,am I wrong?