数据类型

VBA中的数据类型可分为两种

VBA Promming入门教程——变量的使用

VBA Promming入门教程——变量的使用

示例

String

1 Sub Main
2     Dim s as string
3     s = "Hello"
4     msgbox(s)
5 End Sub

Single和Double

1 Sub Main
2     Dim a as Single
3     Dim b as Double
4     a = 10 /3
5     b = 10 / 3
6     MsgBox(a)    '3.333333'
7     MsgBox(b)    '3.33333333333333'
8 End Sub

注:VBA注释符号是单引号

参考链接:https://www.guru99.com/vba-data-types-variables-constant.html

 

相关文章:

  • 2021-09-14
  • 2021-12-04
  • 2022-01-12
  • 2021-12-01
  • 2021-06-02
  • 2021-12-03
  • 2021-12-04
  • 2021-12-04
猜你喜欢
  • 2021-11-10
  • 2021-05-15
  • 2021-11-15
  • 2023-04-08
  • 2022-12-23
  • 2021-10-10
  • 2021-12-25
相关资源
相似解决方案