text1.text = replace(text.text, vblf & vbcr, "")
will remove all empty lines in text box, except if there is empty line at the end