VB--08 写Excel时,设置导出的Excel文件中单元格边框、单元格为数值格式、单元格为文本格式
作者:互联网
边框【Borders.LineStyle = 1】
ExcelSheet.Range(ExcelSheet.Cells(1, 1), ExcelSheet.Cells(DataGrid.Rows,13)).Borders.LineStyle = 1
数值格式【"#,##0.00_ "】
ExcelSheet.Range(ExcelSheet.Cells(2, 5), ExcelSheet.Cells(DataGrid.Rows, 5)).NumberFormatLocal = "#,##0.00_ "
文本格式【"@"】
ExcelSheet.Range(ExcelSheet.Cells(2, 3), ExcelSheet.Cells(DataGrid.Rows, 3)).NumberFormatLocal = "@"
标签:DataGrid,VB,Rows,Cells,单元格,Excel,ExcelSheet,Range 来源: https://blog.csdn.net/Mimo_YY/article/details/121957424