vb6中Excel的设置.doc

上传人:ni****g 文档编号:557768686 上传时间:2023-09-20 格式:DOC 页数:5 大小:38.51KB
返回 下载 相关 举报
vb6中Excel的设置.doc_第1页
第1页 / 共5页
vb6中Excel的设置.doc_第2页
第2页 / 共5页
vb6中Excel的设置.doc_第3页
第3页 / 共5页
vb6中Excel的设置.doc_第4页
第4页 / 共5页
vb6中Excel的设置.doc_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《vb6中Excel的设置.doc》由会员分享,可在线阅读,更多相关《vb6中Excel的设置.doc(5页珍藏版)》请在金锄头文库上搜索。

1、不能单一设置一个CELL的大小,你只能设置该列和该行的大小, 另外设置边框: with xlSheet sheetwork1.Range(.Cells(1, 1), .Cells(Irowcount + 1, _ Icolcount).Borders.LineStyle = xlContinuous end with 其中LineStyle 可为下列 XlLineStyle 常量之一:xlContinuous、xlDash、xlDashDot、xlDashDotDot、xlDot、xlDouble、xlSlantDashDot 或 xlLineStyleNone。Variant 类型,可读写。

2、 不是sheet设置为null,而是NOTHING SET SHEET=NOTHING Top2 楼sqfeiyu(流星雨)回复于 2004-04-12 20:53:25 得分 20只能设置该列和该行的大小 .activesheet.rows(i)=20 =設置列高 .activesheet.cols(i)=10 =設置行寬 释放了内存: .activeworkbook.close set excelApplication=nothingTop3 楼daisy8675(莫依 沉迷)回复于 2004-04-12 20:56:09 得分 2MarkTop4 楼MSTOP(陈建华)回复于 2004-

3、04-12 21:06:39 得分 35设置行高,列宽. Cells.Select Selection.RowHeight = 16 Selection.ColumnWidth = 12 设置A1:F19的边框 Range(A1:F19).Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight

4、= xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdge

5、Right) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorInde

6、x = xlAutomatic End With Range(E10).SelectTop5 楼legsion(小风)回复于 2004-04-12 21:59:36 得分 0 谢谢各位高手鼎力相助,我回去试试看,一旦成功马上回来揭帖Top6 楼zhp80(zhp80)回复于 2004-04-13 12:33:17 得分 2肯定成功!Top7 楼passer_wave(路人)回复于 2004-04-13 12:35:36 得分 2试试先Top8 楼gys_yxr(毛毛)回复于 2004-04-13 12:54:29 得分 2OFFICE 的帮助里有的呀Top9 楼vansoft(Vansoft

7、Workroom)回复于 2004-04-13 14:50:48 得分 0 示例: 设置当前当前工作簿的第一张工作表的第1行高度为20 ActiveWorkbook.Sheets(1).Rows(1).RowHeight = 20 设置当前当前工作簿的第一张工作表的第1列宽度为20 ActiveWorkbook.Sheets(1).Columns(1).ColumnWidth = 20 http:/(新任版主,欢迎光临。) 提供:VB、VBA、Office二次开发免费技术支持; 承接:各类项目开发,如MIS系统,WEB网站,中小型应用软件等等; CO.:Vansoft Workroom MSN

8、:van_ Email: TEL:025-86685867(范,24H)Top10 楼legsion(小风)回复于 2004-04-13 20:04:50 得分 0 我用的是 csdnmzk(迈克尔) 老兄所说如何的设置边框 和 vansoft(Vansoft Workroom)老兄的如何设置行列。特此向两位表示感谢。 同时也谢谢各位的捧场!Top11 楼legsion(小风)回复于 2004-04-13 20:15:52 得分 0 vansoft(Vansoft Workroom)老兄请到这儿拿分:http:/ csdnmzk(迈克尔)老兄请到这儿拿分: http:/ 楼qyii(劳心劳力

9、)回复于 2004-04-13 22:22:11 得分 2mark个Top13 楼yinweihong()回复于 2004-04-14 00:02:04 得分 35我也贴一段 Dim xlApp As Excel.Application Set xlApp = New Excel.Application - 然后,可以用这些变量来访问在EXCEL应用程序中的从属对象、以及这些对象的属性和方法。例如: Set xlApp = CreateObject(Excel.Application) 激活EXCEL应用程序 xlApp.Visible = False 隐藏EXCEL应用程序窗口 Set xl

10、Book = xlApp.Workbooks.Open(strDestination) 打开工作簿,strDestination为一个EXCEL报表文件 Set xlSheet = xlBook.Worksheets(1) 设定工作表 = VB借助EXCEL实现表格设计 1、定义EXCEL对象变量 dim x as excel.application 2、VB中,启动EXCEL set x=createobject(excel.application) 3、新建一个EXCEL工作簿 x.workbooks.add 4、选定工作表1 set xsheet=xbook.worksheets(1) 5、指定单元格,并赋值 xsheet.cell(1,1)=ret.fields(0) 6、指定EXCEL列宽 xsheet.column(1).columnwidth=10 7、RANGE()函数,选定单元格区域 range(cells(1,1),cells(10,20) 8、设置EXCEL字体 xsheet.range(cells(1,1),cells(10,20).font.name=黑体 9、设置EXCEL为粗体 xsheet.range(cells(1,1),ce

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号