c# - Excel how to fit text in cell, based on cell witdh -


i want set witdh of cell in excelsheet.

set witdh:

worksheet.columns["k"].columnwidth = 114.80; 

when text larger columnwith text not visible.

i want split text new row in same cell based on columnwith.

i tried add \r\n string in excel no result.

edit after answers

this works perfectly:

 worksheet.columns["k"].columnwidth = 114;  excel.range rangek = worksheet.get_range("k1");  rangek.entirecolumn.wraptext = true; 

what looking this:

worksheet.range("k1:k100").wraptext = true; 

that code, example, set cells k1 k100 wrap contents inside cells.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -