Distributed mechanical systems such as micromachined resonant strain gages possess an infinite number of modes of vibration. Mostly, one is interested in only one or a few modes. A method is described with which only the desired modes are excited and detected. This is achieved by geometrically shaping the elements used for excitation and detection of the vibration. The method is based on the orthogonality principle, which is valid for a variety of structures and vibrations. In this paper we have restricted ourselves mainly to transversal vibrations of prismatic beams, clamped on both sides (microbridges). The design rules for obtaining the shapes for most commonly used excitation and detection mechanisms are deduced and the effect of axial stress on the suppression of unwanted modes is discussed. The theory was verified by experiments on resonators with selective mode excitation using different excitation mechanisms, as well as on resonators with both selective excitation and detection.