Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone explain the following behaviour, or perhaps more likely,
tell me what I'm doing wrong? I thought I had done this many times before Set up a Userform with a textbox, e.g. TextBox1, that has both EnterKeyBehavior and MultiLine set to True. Enter a single character followed by a Return - the textbox should then contain, for example: "aCRLF" Now, if I want to remove the CRLF, I have been using: With UserForm Do While Right(.TextBox1.Text, 2) = vbCrLf .TextBox1.Text = LeftB(.TextBox1.Text, Len(.TextBox1.Text) - 2) Loop End With Now, this code loops, because when I examine the results of the Left (or LeftB - the results are the same) function, .TextBox1.Text still contains the CRLF. The only way I can get it to work is to store the original text, set .TextBox1.Text to "", and then store the results of the Left function back in the textbox. What is happening here? It's an easy bypass, but I may have used this technique elsewhere and would like to know whether I need to change other instances of this type of code. Excel version is 2002 running on XP professional. Many thanks in advance for any help received. Neil |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I get SQL data to show CRLF instead of question marks? | Excel Discussion (Misc queries) | |||
Cut and Paste Text with CRLF into Single Cell | Excel Discussion (Misc queries) | |||
Making tab do a CRLF when reaching end of a range | Excel Discussion (Misc queries) | |||
HELP - How to replace CRLF with a character withing an excel column | Excel Discussion (Misc queries) | |||
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' | Excel Programming |