The build up of stars and dust in nearby galaxies