欢迎来到天天文库
浏览记录
ID:36010352
大小:33.50 KB
页数:16页
时间:2019-04-28
《英语数字听力软件下载 excel vba编程实例》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、英语数字听力软件下载ExcelVBA编程实例导读:就爱阅读网友为您分享以下“ExcelVBA编程实例”资讯,希望对您有所帮助,感谢您对92to.com的支持!Subdirect_Price()‘‘定义变量DimcRowsAsInteger‘总行数DimcColumnsAsInteger‘总列数DimHEADERCOLORINDEXAsInteger‘表头的背景色DimcTempAsInteger‘临时计数DimsTempStringAsString‘临时字符串变量DimiAsInteger‘临时计数DimjAsInteger‘临时计数DimrowInde
2、xAsInteger‘临时指示处理到哪里DimcolIndexAsInteger‘临时指示处理到哪里DimtempRndColorAsInteger16‘临时生成的颜色DimTABLENAMEAsString‘待处理的表名DimcolorIndexAsString‘颜色索引名字‘表头的背景色HEADERCOLORINDEX=15colorIndex=36‘颜色从33开始是比较浅的颜色TABLENAME=“direct_Price”‘关闭所有弹出的警告消息Application.DisplayAlerts=False‘设置需要处理的单元表Sheets(TA
3、BLENAME).Select‘取单元表的总列数与总行数cRows=Sheets(TABLENAME).UsedRange.Rows.CountcColumns=Sheets(TABLENAME).UsedRange.Columns.Count‘‘‘‘‘选择所有的单元格Range(Cells(1,1),Cells(cRows,cColumns)).Select‘设置该表中所有单元行高为11.25Selection.RowHeight=11.2516‘设置该表中所有单元行高为11.25Selection.RowHeight=11.25‘设置所有的边框Sel
4、ection.Borders(xlDiagonalDown).LineStyle=xlNoneSelection.Borders(xlDiagonalUp).LineStyle=xlNoneWithSelection.Borders(xlEdgeLeft).LineStyle=xlContinuous.Weight=xlThin.colorIndex=xlAutomaticEndWithWithSelection.Borders(xlEdgeTop).LineStyle=xlContinuous.Weight=xlThin.colorIndex=xlAu
5、tomaticEndWithWithSelection.Borders(xlEdgeBottom).LineStyle=xlContinuous.Weight=xlThin.colorIndex=xlAutomaticEndWithWith16Selection.Borders(xlEdgeRight).LineStyle=xlContinuous.Weight=xlThin.colorIndex=xlAutomaticEndWithWithSelection.Borders(xlInsideVertical).LineStyle=xlContinuou
6、s.Weight=xlThin.colorIndex=xlAutomaticEndWith‘并且拆分所有的单元格WithSelection.MergeCells=False‘拆分单格EndWithColumns(“C:C”).SelectSelection.InsertShift:=xlToRight‘删除第一列,注意这里必须先拆分单格,再删除第一列,否则一次就会把合并单元格所在列全部删除Range(Cells(1,1),Cells(1,161)).SelectSelection.EntireColumn.Delete‘Selection.EntireC
7、olumn.Delete‘向表头添加一行Rows(“1:1”).SelectSelection.InsertColumns(“A:A”).SelectSelection.ColumnWidth=9.29Columns(“B:B”).SelectSelection.ColumnWidth=6.71Columns(“C:C”).SelectSelection.ColumnWidth=15.29Columns(“D:D”).SelectSelection.ColumnWidth=29.86Columns(“E:E”).SelectSelection.Colum
8、nWidth=12.29Columns(“F:F”).SelectSelecti
此文档下载收益归作者所有