#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Squares

Whenever i copy text from a text box to a cell, all new lines appear with a
square at the end of it. Anyone know how to stop these squares from
appearing.
Many thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Squares

I suspect this is because the new lines in the textbox are created with
a carriage return and line feed (CHR(13) & CHR(10)) whereas the Excel
cells just use a line feed (CHR(10)). (Although I can't recreate the
problem you experience manually.)

You can clean out the CHR13s by using Replace e.g.
cells("A1") = replace(cells("A1"),vbcr,"")

Replace is only available in Excel 2000 and greater. (You can use athe
worksheet function replace if you're running XL97).

Note however you don't need to do this if you don't copy text and use
code such as:
Cells(1, 1) = TextBox3.Text
to place the text directly in a cell.

HTH,
Gareth

MSL wrote:
Whenever i copy text from a text box to a cell, all new lines appear with a
square at the end of it. Anyone know how to stop these squares from
appearing.
Many thanks,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum of squares if condition jeffrey Excel Worksheet Functions 4 July 22nd 11 12:15 PM
chi squares Rozie Excel Discussion (Misc queries) 1 June 29th 06 09:52 PM
performing least squares Darius Blaszijk Excel Programming 5 March 19th 05 07:25 PM
removing squares and lines in squares that really should be paragr finnadat Excel Discussion (Misc queries) 5 February 10th 05 11:12 PM
Polynomial least squares fit Mark Scholes Excel Programming 2 August 18th 03 12:43 PM


All times are GMT +1. The time now is 04:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"