The point is made in an Atlantic article:
Meaning is not only about transcending the self, but also about transcending the present moment — which is perhaps the most important finding of the study, according to the researchers. While happiness is an emotion felt in the here and now, it ultimately fades away, just as all emotions do; positive affect and feelings of pleasure are fleeting. The amount of time people report feeling good or bad correlates with happiness but not at all with meaning.
Meaning, on the other hand, is enduring. It connects the past to the present to the future. “Thinking beyond the present moment, into the past or future, was a sign of the relatively meaningful but unhappy life,” the researchers write. “Happiness is not generally found in contemplating the past or future.” That is, people who thought more about the present were happier, but people who spent more time thinking about the future or about past struggles and sufferings felt more meaning in their lives, though they were less happy.
Having negative events happen to you, the study found, decreases your happiness but increases the amount of meaning you have in life. Another study from 2011 confirmed this, finding that people who have meaning in their lives, in the form of a clearly defined purpose, rate their satisfaction with life higher even when they were feeling bad than those who did not have a clearly defined purpose. “If there is meaning in life at all,” Frankl wrote, “then there must be meaning in suffering.”