电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

VB中对Excel编程操作实例

VB中对Excel编程操作实例_第1页
1/6
VB中对Excel编程操作实例_第2页
2/6
VB中对Excel编程操作实例_第3页
3/6
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(5, 1)).MergeCells = True '合并单元格.Range(.Cells(6, 1), .Cells(10, 1)).MergeCells = True '合并单元格.Range(.Cells(11, 1), .Cells(13, 1)).MergeCells = True '合并单元格.Range(.Cells(1, 1), .Cells(13, dataM + 2)).Borders.LineStyle = xlContinuous '表格线.Range(.Cells(2, 1), .Cells(13, dataM + 2)).HorizontalAlignment = xlCenter.Cells(1, 1).Font.Size = 12.Cells(1, 1).Font.Name = "黑体".rowS(1).RowHeight = 30'行高For i = 2 To 13.rowS(i).RowHeight = 20NextFor i = 0 To dataM.Columns(i + 3).ColumnWidth = 15 '表格宽度If i <> 0 Then .Cells(2, i + 2).Font.Size = 5.Cells(2, i + 2).Value = Label1(i).CaptionIf dataM > 5 And i <> 0 And abcd = True Then.Cells(3, i + 2).Value = Trim(Left(Right(Label1(i).Caption, 7), 3))Else.Cells(3, i + 2).Value = Label2(i).CaptionEnd IfIf i = 0 Or dataM < 6 Then .Cells(3, i + 2).Value = Label2(i).Caption.Cells(4, i + 2).Value = Label3(i).Caption.Cells(5, i + 2).Value = Label4(i).Caption.Cells(6, i + 2).Valu...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

VB中对Excel编程操作实例

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部