您所在位置: 网站首页 / VB中对Excel编程操作实例.doc / 文档详情
VB中对Excel编程操作实例.doc 立即下载
2024-12-17
约3.2千字
约6页
0
13KB
举报 版权申诉
预览加载中,请您耐心等待几秒...

VB中对Excel编程操作实例.doc

VB中对Excel编程操作实例.doc

预览

免费试读已结束,剩余 1 页请下载文档后查看

10 金币

下载文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

VB中对Excel编程操作实例

vbexcel编程技巧,实例,格式,合并单元格,表格线,页面横向
DimxlAppAsexcel.Application
DimxlBookAsexcel.Workbook
DimxlSheetAsexcel.Worksheet
SetxlApp=CreateObject("Excel.Application")
SetxlBook=xlApp.Workbooks.Add
SetxlSheet=xlBook.Worksheets(1)
DimxRangeAsexcel.Range
Dimm5AsString
DimmsgssAsBoolean
'OnErrorGoTo99
WithxlSheet
Ifabcd=TrueThentmp2="台,"Elsetmp2="个,"
IfdataM>5Thenm5="数量:"&dataM&tmp2Elsem5=""
.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'行高
Fori=2To13
.rowS(i).RowHeight=20
Next
Fori=0TodataM
.Columns(i+3).ColumnWidth=15'表格宽度
Ifi<>0Then.Cells(2,i+2).Font.Size=5
.Cells(2,i+2).Value=Label1(i).Caption
IfdataM>5Andi<>0Andabcd=TrueThen
.Cells(3,i+2).Value=Trim(Left(Right(Label1(i).Caption,7),3))
Else
.Cells(3,i+2).Value=Label2(i).Caption
EndIf
Ifi=0OrdataM<6Then.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).Value=Label5(i).Caption
.Cells(7,i+2).Value=Label6(i).Caption
.Cells(8,i+2).Value=Label7(i).Caption
.Cells(9,i+2).Value=Label8(i).Caption
.Cells(10,i+2).Value=Label9(i).Caption
.Cells(11,i+2).Value=Label10(i).Caption
.Cells(12,i+2).Value=Label11(i).Caption
.Cells(13,i+2).Value=Label12(i).Caption
Next
'设置格式
'.Columns(10).NumberFormatLocal="0.00_"
.rowS(6).NumberFormatLocal="0.000_"
.rowS(7).NumberFormatLocal="0.0_"
.rowS(8).NumberFormatLocal="0.0000_"
.
查看更多
单篇购买
VIP会员(1亿+VIP文档免费下)

扫码即表示接受《下载须知》

VB中对Excel编程操作实例

文档大小:13KB

限时特价:扫码查看

• 请登录后再进行扫码购买
• 使用微信/支付宝扫码注册及付费下载,详阅 用户协议 隐私政策
• 如已在其他页面进行付款,请刷新当前页面重试
• 付费购买成功后,此文档可永久免费下载
全场最划算
12个月
199.0
¥360.0
限时特惠
3个月
69.9
¥90.0
新人专享
1个月
19.9
¥30.0
24个月
398.0
¥720.0
6个月会员
139.9
¥180.0

6亿VIP文档任选,共次下载特权。

已优惠

微信/支付宝扫码完成支付,可开具发票

VIP尽享专属权益

VIP文档免费下载

赠送VIP文档免费下载次数

阅读免打扰

去除文档详情页间广告

专属身份标识

尊贵的VIP专属身份标识

高级客服

一对一高级客服服务

多端互通

电脑端/手机端权益通用