square boxes when using vbcrlf
Dan, thanks for your reply.
I need to retain the formatting, (the CRs and LFs), so I
cant use your example. The problem is that you can go into
excel and manually remove the little boxes and it
does 'not' disrupt the formatting, it leaves the CRs and
LFs in the text. I can make Excel do just about anything,
in code, but cannot get Excel to let me replace the
squares with nothing.
Joan
-----Original Message-----
Private Sub CommandButton2_Click()
temp = TextBox1.Text
For i = 1 To Len(temp)
a = Mid(temp, i, 1)
If a = vbCrLf Or a = vbCr Or a = vbBack Or a =
vbNewLine Or a = vbTab Or a = vbLf Then
temp = Left(temp, i - 1) & Right(temp, Len
(temp) - i - 1)
End If
Next
TextBox1.Text = temp
End Sub
removes the boxes and adds nothing in their place.
watch out for word wrap
Dan E
"Joan" wrote in message
...
KBArticle 169972 says:
In Microsoft Excel 97 for Windows, if you use these
constants when you insert text into a text box or into a
cell, a square character may appear in the text box or
cell. This problem occurs if you use any of the
following
constants:
vbBack vbCr vbCrLf vbNewLine vbTab
......You can remove the square character by manually
editing the cell.
______________________________
I have found that this behavior is also in Excel 2000
and
XP. The KB article above is a couple years old. Has
anyone found a solution to removing the boxes
programmatically. I've tried everything I can think of.
Thanks
joan
.
|