There are several types of exclamatory sentences. The exclamation can refer to a noun, to an adjective, to an adverb, or to a verb.
If the exclamation refers to a noun, we use « what » or « such ». What a sweetheart you are!
If the exclamation refers to an adjective, an adverb, or a verb, we use « how » or « so ».
How nice it was to see you!