nbsp; rst_tsf.MoveFirst
End If
rst_qm.Open "qianming", con, adOpenKeyset, adLockOptimistic, adCmdTable
rst_qm.MoveFirst
''*********************************工作表初使化**********************************
Dim xlsheet As excel.Worksheet
Set xlsheet = xlbook.Sheets.Add
xlsheet.Name = "机械台时、组时费汇总表"
xlsheet.Columns(1).ColumnWidth = 5
xlsheet.Columns(2).ColumnWidth = 20
xlsheet.Columns(3).ColumnWidth = 7
xlsheet.Columns(4).ColumnWidth = 7
xlsheet.Columns(5).ColumnWidth = 7
xlsheet.Columns(6).ColumnWidth = 7
xlsheet.Columns(7).ColumnWidth = 7
xlsheet.Columns(8).ColumnWidth = 7
xlsheet.Columns(9).ColumnWidth = 7
xlsheet.Columns("A:I").Font.Size = 9
xlsheet.Columns("A:I").VerticalAlignment = xlVAlignCenter ''垂直居中
xlsheet.Columns(1).HorizontalAlignment = xlHAlignCenter ''1列水平居中对齐
xlsheet.Columns(2).HorizontalAlignment = xlHAlignLeft ''2列水平左对齐
''******************************写入标头************************************
xlsheet.Rows(1).RowHeight = 35
xlsheet.Range(xlsheet.Cells(1, 1), xlsheet.Cells(1, 9)).MergeCells = True
xlsheet.Cells(1, 1).Font.Size = 14
xlsheet.Cells(1, 1).Font.Bold = True
xlsheet.Cells(1, 1).Value = "机械台时、组时费汇总表"
xlsheet.Cells(2, 9).Value = "单位:元"
xlsheet.Range(xlsheet.Cells(3, 1), xlsheet.Cells(5, 1)).MergeCells = True
xlsheet.Cells(3, 1).Value = "编号"
xlsheet.Range(xlsheet.Cells(3, 2), xlsheet.Cells(5, 2)).MergeCells = True
xlsheet.Cells(3, 2).Value = "机械名称"
xlsheet.Range(xlsheet.Cells(3, 3), xlsheet.Cells(5, 3)).MergeCells = True
xlsheet.Cells(3, 3).Value = "台时费"
xlsheet.Range(xlsheet.Cells(3, 4), xlsheet.Cells(3, 9)).MergeCells = True
xlsheet.Cells(3, 4).Value = "其 中"
xlsheet.Range(xlsheet.Cells(3, 3), xlsheet.Cells(5, 3)).MergeCells = True
xlsheet.Cells(3, 3).Value = "台时费"
xlsheet.Range(xlsheet.Cells(4, 4), xlsheet.Cells(5, 4)).MergeCells = True
xlsheet.Cells(4, 4).Value = "折旧费"
xlsheet.Range(xlsheet.Cells(4, 5), xlsheet.Cells(5, 5)).MergeCells = True
xlsheet.Cells(4, 5).Value = "修理替换费"
xlsheet.Range(xlsheet.Cells(4, 6), xlsheet.Cells(5, 6)).MergeCells = True
xlsheet.Cells(4, 6).Value = "安拆费"
xlsheet.Range(xlsheet