当前位置:编程学习 > VB >>

送分100分:关于VBA中参数的问题

问题一:以下代码中,xlDiagonalDown、xlContinuous、xlEdgeLeft这些符号常量,哪儿可以查到。
   With Selection.Borders(xlDiagonalDown)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlDiagonalUp)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlDouble
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
问题二:要学好VBA,需要看什么书,请大家帮忙推荐一下。 --------------------编程问答-------------------- 查查google

vba要看针对什么了 --------------------编程问答--------------------
引用
问题一:以下代码中,xlDiagonalDown、xlContinuous、xlEdgeLeft这些符号常量,哪儿可以查到。


EXCEL自带的VBA帮助手册中


LineStyle 属性
参阅应用于示例特性返回或设置边框的线型。XlLineStyle 类型,可读写。

XlLineStyle 可为以下 XlLineStyle 常量之一。 
xlContinuous 
xlDash 
xlDashDot 
xlDashDotDot 
xlDot 
xlDouble 
xlSlantDashDot 
xlLineStyleNone 



XlLineStyle

常量 值 
xlContinuous  1 
xlDash  -4115 
xlDashDot  4 
xlDashDotDot  5 
xlDot  -4118 
xlDouble  -4119 
xlLineStyleNone  -4142 
xlSlantDashDot  13 
--------------------编程问答-------------------- F1 --------------------编程问答-------------------- EXCEL自带的VBA帮助
--------------------编程问答-------------------- Sub test3()
   MsgBox xlNone
   MsgBox xlContinuous
   MsgBox xlMedium
   MsgBox xlAutomatic
   MsgBox xlDiagonalDown
   MsgBox xlDiagonalUp
   MsgBox xlEdgeLeft
   MsgBox xlEdgeTop
   MsgBox xlEdgeBottom
   MsgBox xlEdgeRight
   MsgBox xlInsideVertical
   MsgBox xlInsideHorizontal
End Sub

--------------------编程问答-------------------- debug.print "变量名 =" & 变量的值
debug.print "变量名 =" & 变量的值
debug.print "变量名 =" & 变量的值
这样打印一下就清楚了。 --------------------编程问答-------------------- A)打开对象浏览器(快捷键 F2),搜索
B)在代码中选中该常量,右键菜单\定义,可以跳到对象浏览器并直接定位 --------------------编程问答-------------------- 我的excel没有自带的VBA帮助
经常用的是直接debug.print --------------------编程问答-------------------- 学习
--------------------编程问答-------------------- VBA本地帮助或联机帮助。

--------------------编程问答-------------------- ------从网上下载个VBA的API就行了。----

例如:
LineStyle 属性
参阅应用于示例特性返回或设置边框的线型。XlLineStyle 类型,可读写。

XlLineStyle 可为以下 XlLineStyle 常量之一。 
xlContinuous 
xlDash 
xlDashDot 
xlDashDotDot 
xlDot 
xlDouble 
xlSlantDashDot 
xlLineStyleNone 

expression.LineStyle
expression      必需。该表达式返回“应用于”列表中的对象之一。

示例
本示例为 Chart1 的图表区和绘图区域设置边框。

With Charts("Chart1")
    .ChartArea.Border.LineStyle = xlDashDot
    With .PlotArea.Border
        .LineStyle = xlDashDotDot
        .Weight = xlThick
    End With
End With

--------------------编程问答--------------------
补充:VB ,  VBA
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,