Getting them on pellets is harder the older they get, IMO sooner is better than later.
Starve for 2 days and try the pellets a few times a day( couple sinking pellets at a time are best).
If they dont eat them in those 2 days then feed something they'll eat but just enough to tide them over. Do the same thing for the next two days then three days, then up to 4 days. By the fourth day they should take the pellets, you're giving them food so they will take to it.
With floating pellets its usually harder because they are more cautious about coming up for them, and be sure that they are small enough for them too