Valtrex is used to treat infections caused by herpes simplex virus (HSV), varicella zoster (VZV), and cytomegalovirus (CMV), such as cold sores, shingles, chickenpox, and different forms of herpes.