Enter Symbol showing on worksheet from text box entry

J

jennie

Hi

I am using Excel 2000.
I have a userform with some textboxes on, quite a lot of text is goin
to be entered into them, so i would like the user to be able to chang
paragraph.

I have set the textbox EnterKeyBehaviour Property to True this allow
the user to press enter and instead of going onto the next text box, i
starts a new line.
However, here's the problem:
Whenever the enter key is pressed, when the data is stored back ont
the worksheet, or printed, a small empty box symbol is displayed a
enter.

_
Eg. when I change line l_l
I get a box at the end!

Does anyone know how I can stop this from happening, I do not want t
print or show this symbol, but I do want users to be able to chang
onto a new line.

Thanks a lot for any help
Jenni
 
T

Tom Ogilvy

an enter key puts in the combination vbCrLf which is Char(13) &
Char(10). The box you see is the Char(13). You can remove it using the
replace command if you are populating your cells with code rather than
linking them (if you are linking them, then remove the link and use code
like below).

Range("B9").Value = Replace(Textbox1.Text,chr(13),"")

Private Sub TextBox1_Change()
Worksheets(1).Range("B9") = Replace(TextBox1.Text, Chr(13), "")
End Sub


Just for interest, this seems to be fixed in Excel 2002.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top