Extra Characters

B

Bob Inwater

I am writing a VBA Mac that will read a table from Word and populate a MS
Project File. I have most of it worked out so far except that I have to trim
the (what do ya call them?) square characters (Cell Markers?) from the text
in each cell. That would be no big deal if there was always the same number
before and after each string. Since they do not show up consistently I have
having trouble editing them out.

First of all what is the proper name for this character and secondly any
ideas deleting them on a conditional basis?

Thanks a Ton,

Bob
 
J

Jezebel

Every cell terminates with chr(13)chr(7). chr(13) is simply a return (vbCR)
same as any end-of-paragraph; chr(7) is used by Word as the end-of-cell
marker Normally you can just strip the final two characters from the cell
contents; but your reference to consistency suggests that you have something
else going on as well -- presumably an artefact of how the cell contents are
formatted. You can use the ASC() function to determine what the characters
actually are, and use the Replace() function to remove them.
 
B

Bob Inwater

Thanks a Ton! I added the below code and it works great.

If Left(x, 1) = Chr(13) Then
x = Right(x, Len(x) - 1)
End If

If Right(x, 1) = Chr(13) Then
x = Left(x, Len(x) - 1)
End If
 
Top