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

VBA编程实例VIP免费

VBA编程实例_第1页
1/25
VBA编程实例_第2页
2/25
VBA编程实例_第3页
3/25
Sub direct_Price() ''定义变量 Dim cRows As Integer '总行数 Dim cColumns As Integer '总列数 Dim HEADERCOLORINDEX As Integer '表头的背景色 Dim cTemp As Integer '临时计数 Dim sTempString As String '临时字符串变量 Dim i As Integer '临时计数 Dim j As Integer '临时计数 Dim rowIndex As Integer '临时指示处理到哪里 Dim colIndex As Integer '临时指示处理到哪里 Dim tempRndColor As Integer '临时生成的颜色 Dim TABLENAME As String '待处理的表名 Dim colorIndex As String '颜色索引名字 '''''''''''''''''''''''''''''''''''''''''''''' '表头的背景色 HEADERCOLORINDEX = 15 colorIndex = 36 '颜色从33 开始是比较浅的颜色 TABLENAME = "direct_Price" '关闭所有弹出的警告消息 Application.DisplayAlerts = False '设置需要处理的单元表 Sheets(TABLENAME).Select '取单元表的总列数与总行数 cRows = Sheets(TABLENAME).UsedRange.Rows.Count cColumns = Sheets(TABLENAME).UsedRange.Columns.Count '''''''''''''''''''''''''''''''''''''''''''''' '选择所有的单元格 Range(Cells(1, 1), Cells(cRows, cColumns)).Select '设置该表中所有单元行高为 11.25 Selection.RowHeight = 11.25 '设置该表中所有单元行高为 11.25 Selection.RowHeight = 11.25 '设置所有的边框 Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = 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(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .colorIndex = xlAutomatic End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .colorIndex = xlAutomatic End With '并且拆分所有的单元格 With Sele...

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

碎片内容

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