M_S*_*JAN 1 excel vba excel-vba
我正面临一个小问题请帮帮我.
sub vari()
dim b as integer
dim c as integer
b=6
c=8
end sub
Run Code Online (Sandbox Code Playgroud)
现在我想在另一个函数中使用b和c.
sub calculate()
dim a as integer
a = c+b
end sub
Run Code Online (Sandbox Code Playgroud)
我在这里得到错误
您希望为变量使用适当的范围.如果你想让var和()和calculate()都能访问b和c,你需要全局声明它们,如下所示:
Public b As Integer
Public c As Integer
sub vari()
....
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18638 次 |
| 最近记录: |