It's not as easy to do as it seems. Sunscreen blocks light in the uva and uvb . These are in the range of 360 nm to 200 nm. If you want to use the spectrometer for this, there are a couple of issues. One is the light source. Typically, a deuterium lamp is used as the light source. This is a quite expensive lamp. You might be able to use the mercury lines from a cfl to get some of the lines- that would take some experimentation but there was some work done on it.
The other problem is the cuvettes used to measure the absorbance with. Most of them are plastic and have a cutoff of about 350 nm. If you get acrylic ones, you might be able to go slightly lower. But you want to measure substances that absorb much lower-200 nm. This is usually done with quartz cuvettes. Again, cost is the issue.
Double check your spectrometer before you worry about cuvettes and light source. Make sure it can go down to 200 nm. Then worry about the light source and cuvettes.