String variable problems

S

Sasa

Hello,
I have encountered this problem: I have tried to define
string variable from table cell text by using this code:

Dim strvar as String
strvar = Table.Cell(x,y).Range.Text

but the problem is that after that, string varible
contains some additional invisible characters defined
as "squares" when displayed (for example with code: MsgBox
strvar), so the string is about 2 or 3 characters longer
then in table cell, only because of these "squares".
So the result looks like this:

How can I define the exact text in table cell without
these "squares"?

I hope it is not too confusing.

Any solutions?
Thanks.

Regards.
 
C

Cindy M -WordMVP-

Hi Sasa,

You need to trim off the last two characters. Roughly

strvar = Table.Cell(x,y).Range.Text
strvar = Left(strvar, Len(strvar)-2)
I have encountered this problem: I have tried to define
string variable from table cell text by using this code:

Dim strvar as String


but the problem is that after that, string varible
contains some additional invisible characters defined
as "squares" when displayed (for example with code: MsgBox
strvar), so the string is about 2 or 3 characters longer
then in table cell, only because of these "squares".
So the result looks like this:

How can I define the exact text in table cell without
these "squares"?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

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