Cell text with format

R

René Nordby

Hi there,
I have a problem, that I hope someone could give me a solution for.

I have a table, which I make a For Each Row on and collect some text from
some of the rows. I want to get the text include format, so I use the
property .FormattedText on the .Range object of the cell. I 'save' the
..FormattedText in a Range variable.

Later in my code i create a new document with a new table, and now I want
add my saved text to a specific cell in the new table, but it goes wrong.

I really don't have any clue on what's going wron, because I use the right
cell, but anyway the text is add to another cell.

If I use .Text property instead of the .FormattedText property, both where I
'save' the text and where I add teh text, then it works.

This is the code where I 'save' the text
Set myRange = myRow.Cells.Item(4).Range.FormattedText

This is the code where I add teh text
myRow.Cells.Item(4).Range.FormattedText = myRange.FormattedText
 
H

Helmut Weber

Hi René,

have you tried to cut off the end of cell mark?
Set myRange = myRow.Cells.Item(4).Range.FormattedText

MyRange.end = myrange.end - 1

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 

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