MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Problems with Text in cells and userforms

Posted by Diego m on January 23, 2002 1:59 PM

please, could somebody help me?
my version is EXCEL 97
I´ve got a standard workbook with sheets, and i want to write some text in 1 cell, (for example in cell(1,1).
Wide for this cell is 200 (for example).
Wraptext property is true.
When I start to write, and text is more than wideness for that column, automatically text is adjusted and high of that row is increased.
With ALT+ENTER, we can change to a different sentence inside of that cell.
This action (ALT+ENTER) it´s like (i think) Chr$(13).
follow with problem:
I make a userform with 2 commandbuttoms and 1 text_box.
and a procedure to make click in the 1º buttom to copy text from original cell (1,1) to text_box.
everythings it looks in good order.
With another procedure, we make click in the 2ºcommandbuttom in order to copy text in another cell, for example in cell (2,2).
The text are exactly the same except that at the end of each sentence there is a small square character.
How can avoid it?

Posted by Tom Dickinson on January 24, 2002 2:51 PM

The Alt+Enter actually inserts a Chr(10). I did a little testing and got rid of the box in the cell that the text was copeid to (in my test the cell was A2) by using the foolowing in my command button macro:

Range("A2").Replace What:=Chr(13), Replacement:=""

Hope this helps