EcelVBA编程的常用代码.pdfVIP

  • 0
  • 0
  • 约3.45万字
  • 约 29页
  • 2022-02-12 发布于上海
  • 举报
Excel VBA 编程的常用代 码 用过 VB 的人都应该知道如何声明变量,在 VBA 中声明变量和 VB 中是完全一样的! 使用 Dim 语句 Dim a as integer 声明 a 为整型变量 Dim a 声明 a 为变体变量 Dim a as string 声明 a 为字符串变量 Dim a as currency ,b as currency ,c as currency 声明 a,b,c 为货币变量 声明变量可以是: Byte 、Boolean 、 Integer 、Long 、Currency 、Single 、Double 、Decimal (当前不 支持)、 Date 、String (只限变长字符串)、 String * length (定长字符串)、 Object 、Variant 、用户 定义类型或对象类型。 强制声明变量 Option Explicit 说明:该语句必在任何过程之前出现在模块中。 声明常数 用来代替文字值。 Const 常数的默认状态是 Private 。 Const My = 456 声明 Public 常数。 Public Const M

文档评论(0)

1亿VIP精品文档

相关文档