Apparatus and method for carrying out compaction operations on molded bodies that consist of granular materials and are placed on pallets, the compaction being achieved by impact of a vibrating table on the underside of the pallet. The vibrating table, together with a spring system forms a mass-spring system, which acts as a vibrator capable of oscillation that is excited by an excitation device to produce forced vibrations. The spring system, together with the system mass, is designed to develop at least one individual frequency within the range of the compaction frequency, whereby it is also possible to adjust the individual frequency gradually or continuously. This, together with the fact that the excitation frequency can be adjusted, allows the vibrator to be operated partially or completely in resonance mode over the whole frequency range of the compaction.