2010-03-12 47 views

回答

2

你可以只使用 「\ n」 的字符串

Excel.Range dataRange= (Excel.Range)excelWorksheet.get_Range("C4", "C4"); 
dataRange.Value2 = "This is the first line\n" + 
     "This is the second line\n" +   
     thirdLineString; 
+0

感謝亞爾...尼斯碼 – Suryakavitha 2010-03-12 10:33:27

0

以你想要的線,並把它們放到一個數組,然後將它們連接成一個字符串,由換行符分割:

String singleCell = String.Join("\n",lines) 

,然後刪除該字符串進入細胞。

相關問題