VB 中对 Excel 编程操作实例 vb excel 编程技巧,实例,格式,合并单元格,表格线,页面横向Dim xlApp As excel
Application Dim xlBook As excel
Workbook Dim xlSheet As excel
Worksheet Set xlApp = CreateObject("Excel
Application") Set xlBook = xlApp
Workbooks
Add Set xlSheet = xlBook
Worksheets(1) Dim xRange As excel
Range Dim m5 As String Dim msgss As Boolean 'On Error GoTo 99With xlSheetIf abcd = True Then tmp2 = "台," Else tmp2 = "个,"If dataM > 5 Then m5 = " 数量:" & dataM & tmp2 Else m5 = " "
Cells(1, 1)
Value = lb1
Caption & m5 & Label15
Caption
Cells(2, 1)
Value = "基本信息"
Cells(6, 1)
Value = "额定性能" & Chr(10) & Text1
Text & "rpm"
Cells(11, 1)
Value = "堵转"
Columns(1)
ColumnWidth = 8 '表格宽度
Columns(2)
ColumnWidth = 18 '表格宽度'
Range(
Cells(1, 1),
Cells(1, 5))
MergeCells = True '合并
Range(
Cells(2, 1),
Cells(