Removing the end of text characters in table cells

H

hals_left

Hi,

I have read a few posts on this but still dont have a foolproof way of
removing the end of text characters that appear after the text in
table cells.

I would like to use the vbScript replace funcction but cannot find the
vb constant for this character.Does one exist?

Any other ways for removing one or two of the squares from the end of
a string?

Thanks
hals_left
 
P

Peter Hewett

Hi

Try this little function:

Public Function CellValue(ByVal celItem As Word.Cell) As String
Dim strCellValue As String

strCellValue = celItem.Range.Text
CellValue = Left$(strCellValue, Len(strCellValue) - 2)
End Function

Use it something like this:

Debug.Print CellValue(ActiveDocument.Tables(1).Cell(1,2))

HTH + Cheers - Peter


[email protected] (hals_left) wrote in
 
Top