ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ASCII 133 -- Accented A or Ellipse (https://www.excelbanter.com/excel-programming/285214-ascii-133-accented-ellipse.html)

Tim Wilson

ASCII 133 -- Accented A or Ellipse
 
Product: Excel XP / VBA (US)
Platform: Windows 2000

Issue: When the three characters "..." are read from an
Excel cell into a fixed length string variable, VBA
interprets the string as a single character rather than
three characters. This is a problem for my application.
Here is how you can re-create this issue:

In Excel, put this string in cell A1 "1...1"

In VBA, do the following.

------------------------------
Sub TestRoutine()
Dim strTest As String * 1
strTest = Mid(Cells(1, 1), 2, 1)
MsgBox Asc(strTest)
MsgBox Len(Cells(1, 1).Value)
End Sub
-------------------------------

In the first message box, VBA will display ASCII value
133 -- it should be 46.

In the second message box, VBA displays a string length of
3, it should be 5.

Any ideas how to alter this behavior? Couldn't find a
reference in Microsoft support.

Thanks.

--
Tim Wilson
CHRISTUS Health





Tim Wilson

ASCII 133 -- Accented A or Ellipse
 
My apologies to the group. I found the answer in a
previous email when I searched on "133". This is behavior
as designed.

Deleting the elipsis (...) from autocorrect resolves the
issue.

Thanks Jaf -- I don't think I would have figured that one
out.

Later.

--

Tim Wilson


-----Original Message-----
Product: Excel XP / VBA (US)
Platform: Windows 2000

Issue: When the three characters "..." are read from an
Excel cell into a fixed length string variable, VBA
interprets the string as a single character rather than
three characters. This is a problem for my application.




All times are GMT +1. The time now is 04:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com