This project is read-only.

New line in cell

Mar 12, 2010 at 1:27 PM

Hi,

I've been trying to add a new line to a cell and not having much luck. I've managed to get it to kind of work using vbLf as the new line character; using this I get a visible character when i open the spreadsheet but then if i go to edit the value of the cell it changes into a new line. Is there a better way to do this which will make the new line character appear correctly to start with?

Thanks,

Phil

Apr 11, 2010 at 9:46 PM

Phil

Try System.Environment.NewLine

 

for example

SetCellValue("Hello," + System.Environment.NewLine + " World!")

May 19, 2010 at 6:32 PM

Hi, W4IK!

This doesn't seem to work.

Do you have any other suggestions?

Thanks!

 

May 19, 2010 at 6:38 PM

Hi,

I figured this out after, what W4IK said is correct, but you also need to make sure you have WrapText set to true in the cell style.

Phil 

May 19, 2010 at 6:42 PM

Thank you very much, Phil!