Excel VBA冒号 [英] Excel VBA Colon
本文介绍了Excel VBA冒号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
VB使用冒号将两个语句放在同一行
Possible Duplicate:
VB Using colons to put two statements on same line
我在Excel VBA中具有以下声明
I have the following declaration in Excel VBA
Public Const cdbArea = 1: Public Const cdbDist = 2: Public Const cdbChange1 = 4: Public Const cdbChange2 = 5: Public Const cdbTR = 5:
Public Const crbArea = 1: Public Const crbDist = 2: Public Const crbTerr = 3: Public Const crbChange1 = 4: Public Const crbTR = 5:
Public Const cdbWeek1 = 4
乍一看,冒号看起来像分隔符,但我以前从未使用过这种语法.
On first glance, the Colons look like separators, but I have never used this syntax before.
冒号是做什么用的?
推荐答案
如果愿意,可以将语句放在单独的行上
You can put the statements on separate lines, if you like:
Public Const cdbArea = 1
Public Const cdbDist = 2
Public Const cdbChange1 = 4
或者,您也可以像上面的示例一样用冒号分隔它们.
Or, you can separate them with colons as in your example above.
这篇关于Excel VBA冒号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文