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
Post a Comment