|
VB中使用EXCEL输出(10) xlsheet.Range(xlsheet.Cells(4, 6), xlsheet.Cells(5, 6)).MergeCells = True xlsheet.Cells(4, 6).Value = "安拆费" xlsheet.Range(xlsheet.Cells(4, 7), xlsheet.Cells(5, 7)).MergeCells = True xlsheet.Cells(4, 7).Value = "人工费" xlsheet.Range(xlsheet.Cells(4, 8), xlsheet.Cells(5, 8)).MergeCells = True xlsheet.Cells(4, 8).Value = "燃料费" xlsheet.Range(xlsheet.Cells(4, 9), xlsheet.Cells(5, 9)).MergeCells = True xlsheet.Cells(4, 9).Value = "其他费" xlsheet.Range(xlsheet.Cells(1, 1), xlsheet.Cells(5, 9)).HorizontalAlignment = xlHAlignCenter xls.ActiveSheet.PageSetup.PrintTitleRows = "$1:$5" '固定表头 '****************************************写入内容************************************* Dim i As Integer i = 6 Do While Not rst_tsf.EOF xlsheet.Cells(i, 1).Value = rst_tsf.Fields("nn") xlsheet.Cells(i, 2).Value = rst_tsf.Fields("name") xlsheet.Cells(i, 3).Value = rst_tsf.Fields("price") xlsheet.Cells(i, 4).Value = rst_tsf.Fields("zhejiu") xlsheet.Cells(i, 5).Value = rst_tsf.Fields("xiuli") xlsheet.Cells(i, 6).Value = rst_tsf.Fields("anchai") xlsheet.Cells(i, 7).Value = rst_tsf.Fields("rengong") xlsheet.Cells(i, 8).Value = rst_tsf.Fields("dongli") xlsheet.Cells(i, 9).Value = rst_tsf.Fields("qita") If i > 22 Then
|