Ecclesiastes 7:14
"In the day of prosperity be joyful, but in the day of adversity consider: God also hath set the one over against the other, to the end that man should find nothing after him."
Cross References (ranked by relevance)
Wherefore I perceive that there is nothing better, than that a man should rejoice in his own works; for that is his portion: for who shall bring him to see what shall be after him?
A time to weep, and a time to laugh; a time to mourn, and a time to dance;
And he humbled thee, and suffered thee to hunger, and fed thee with manna, which thou knewest not, neither did thy fathers know; that he might make thee know that man doth not live by bread only, but by every word that proceedeth out of the mouth of the LORD doth man live.
Let us hear the conclusion of the whole matter: Fear God, and keep his commandments: for this is the whole duty of man.
Because thou servedst not the LORD thy God with joyfulness, and with gladness of heart, for the abundance of all things;
Is any among you afflicted? let him pray. Is any merry? let him sing psalms.
LORD, when thy hand is lifted up, they will not see: but they shall see, and be ashamed for their envy at the people; yea, the fire of thine enemies shall devour them.
It is good for me that I have been afflicted; that I might learn thy statutes.
And he hath put a new song in my mouth, even praise unto our God: many shall see it, and fear, and shall trust in the LORD.
The LORD’s voice crieth unto the city, and the man of wisdom shall see thy name: hear ye the rod, and who hath appointed it.
But go ye and learn what that meaneth, I will have mercy, and not sacrifice: for I am not come to call the righteous, but sinners to repentance.
The anger of the LORD shall not return, until he have executed, and till he have performed the thoughts of his heart: in the latter days ye shall consider it perfectly.
Confirming the souls of the disciples, and exhorting them to continue in the faith, and that we must through much tribulation enter into the kingdom of God.
Therefore he hath poured upon him the fury of his anger, and the strength of battle: and it hath set him on fire round about, yet he knew not; and it burned him, yet he laid it not to heart.
Yet if they shall bethink themselves in the land whither they were carried captives, and repent, and make supplication unto thee in the land of them that carried them captives, saying, We have sinned, and have done perversely, we have committed wickedness;
Vanity of vanities, saith the preacher; all is vanity.