下载此文档

VBA编程实例.doc


文档分类:IT计算机 | 页数:约25页 举报非法文档有奖
1/25
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/25 下载此文档
文档列表 文档介绍
Sub direct_Price()
''定义变量
Dim cRows As Integer '总行数
olumns 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"
'关闭所有弹出的警告消息
= False
'设置需要处理的单元表
Sheets(TABLENAME).Select
 '取单元表的总列数与总行数
cRows = Sheets(TABLENAME).
cColumns = Sheets(TABLENAME).
   
''''''''''''''''''''''''''''''''''''''''''''''
   
     '选择所有的单元格
 Range(Cells(1, 1), Cells(cRows, cColumns)).Select
 
   '
  =
 
   
'
  =
 
 '设置所有的边框
 (xlDiagonalDown).LineStyle = xlNone
    (xlDiagonalUp).LineStyle = xlNone
    With (xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .colorIndex = xlAutomatic
    End With
    With (xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .colorIndex = xlAutomatic
    End With
    With (xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .colorIndex = xlAutomatic
    End With
    With (xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .colorIndex = xlAutomatic
    End With
    With (xlInsideVertical)
        .LineStyle = xlContinuous
        .Weight = xlThin
     
   .colorIndex = xlAutomatic
    End With
   
   '并且拆分所有的单元格
 With Selection
        .MergeCells = False '拆分单格
 End With
 
 Columns("C:C").Se

VBA编程实例 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数25
  • 收藏数0 收藏
  • 顶次数0
  • 上传人xgs758698
  • 文件大小0 KB
  • 时间2015-06-04
最近更新