We report a determination of the complex in-plane dielectric function of monolayers of four transition-metal dichalcogenides: , , , and , for photon energies from 1.5 to 3 eV. The results were obtained from reflection spectra using a Kramers-Kronig constrained variational analysis. From the dielectric functions, we obtain the absolute absorbance of the monolayers. We also provide a comparison of the dielectric function for the monolayers with the corresponding bulk materials.