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


(e-mail address removed) (hals_left) wrote in
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top