excel列(單元格)格式的控制????

mySheet.Cells(1,9).NumberFormatLocal = "@"
Excel.Range r = mySheet.get_Range(mySheet.Cells[1, 1], mySheet.Cells[1,3]);
r.NumberFormat = "@";
r.NumberForma = "0.00_ "
r.NumberForma = "¥#,##0.00;¥-#,##0.00"
r.NumberForma = _"_ ¥* #,##0.00_ ;_ ¥* -#,##0.00_ ;_ ¥* ""-""??_ ;_ @_ "
r.NumberForma = "yyyy-m-d"
r.NumberForma = "[$-F400]h:mm:ss AM/PM"
r.NumberForma = "000000"
myExcel.get_Range(myExcel.Cells[1, 1], myExcel.Cells[1, 1]).Font.Bold = true;
myExcel.get_Range(myExcel.Cells[1,1],myExcel.Cells[1,1]).Font.Size = 16;

//文本:vnd.ms-excel.numberformat:@
//日期:vnd.ms-excel.numberformat:yyyy/mm/dd
//数字:vnd.ms-excel.numberformat::#,##0.00
//货币:vnd.ms-excel.numberformat¥#,##0.00
//百分比:vnd.ms-excel.numberformat:#0.00%

//文本
列:
((Excel.Range)mySheet.Columns["D:D", System.Type.Missing]).NumberFormatLocal = "@";

單元格
Excel.Application.get_Range(excelApp.Cells[1, 1], excelApp.Cells[1, 3]).NumberFormatLocal="@"

你可能感兴趣的:(Excel)