您的位置:程序门 -> vb -> vba



excel宏vb编程问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


excel宏vb编程问题
发表于:2007-11-01 16:59:20 楼主
我录制了一个宏macro1,这个宏是对字体做了一些操作:黑体,加粗等等,录制完之后,
对其他字体执行这个宏操作,然后我进入vb编译器查看这个宏的代码:
sub   macro1()
'
'   macro1   macro
'   宏由   番茄花园   录制,时间:   2007-11-1
'

'
        with   selection.font
                .name   =   "黑体"
                .fontstyle   =   "加粗"
                .size   =   12
                .strikethrough   =   false
                .superscript   =   false
                .subscript   =   false
                .outlinefont   =   false
                .shadow   =   false
                .underline   =   xlunderlinestylenone
                .colorindex   =   17
        end   with
        selection.borders(xldiagonaldown).linestyle   =   xlnone..........(1)
        selection.borders(xldiagonalup).linestyle   =   xlnone
        selection.borders(xledgeleft).linestyle   =   xlnone
        with   selection.borders(xledgetop).............................(2)
                .linestyle   =   xlcontinuous.................................(3)
                .weight   =   xlthin..........................................(4)
                .colorindex   =   xlautomatic.................................(5)
        end   with
        selection.borders(xledgebottom).linestyle   =   xlnone
        with   selection.borders(xledgeright)
                .linestyle   =   xlcontinuous
                .weight   =   xlthin
                .colorindex   =   xlautomatic
        end   with
end   sub
请问一下,(1)中代码的具体意思和它的作用,特别是selection.borders().linestyle的意思
                    (2)至(5)代码的具体意思和作用
发表于:2007-11-01 17:55:111楼 得分:0
1:去除选择区域从左上到右下的斜线(即设置为none)
2:设置选区上部线条的属性
3:线条为连续线
4:粗细为“细”     (   thin)
5:颜色为“自动”


快速检索

最新资讯
热门点击