The magnetic field in the Sun undergoes a cyclic modulation with a reversal typically every 11 years due to a dynamo operating under the surface. Also, other solar-like stars exhibit magnetic activity, most of them with much higher levels compared to the Sun. Some of these stars show cyclic modulation of their activity similar to the Sun. The rotational dependence of activity and cycle length suggests a common underlying dynamo mechanism.Here we present results of 3D MHD convective dynamo simulations of slowly and rapidly rotating solar-type stars, where the interplay between convection and rotation self-consistently drives a large-scale magnetic field. With the help of the test-field method, we are able to measure the turbulent transport coefficients in these simulations and therefore get insights about the dynamo mechanism operating in these simulations. It allows us to derive a scaling of the cycle period with the relevant effects of the dynamo.We discuss how magnetic helicity is a key quantity connecting the stellar convection zone with the stellar surface and stellar coronae. Magnetic helicity is produced in the convection zone of stars via a dynamo in the presence of convection and rotation. At the surface, it plays an important role in the formation process of active regions. In the corona, it is believed to be essential for the release of energy leading to the eruption of plasma via coronal mass ejections and is thought to play an important role in the heating process of the coronal plasma. Numerical simulations of stellar convection zones and the solar corona allow us to investigate this process.