Yes, you can leave frosted cupcakes or cakes in a sealed container for 1-2 days. If they last longer than that, place them in the refrigerator.