2
從VBA教程之一,我瞭解到,變量contining數字應該首先聲明爲整數:爲什麼這個代碼在VBA電源點工作的罰款不用其他點心。數字命令?
Dim mynumber as integer
但是,請看看這段代碼:
Sub math()
A = 23
B = 2
ABSumTotal = A + B
strMsg = "The answer is " & "$" & ABSumTotal & "."
MsgBox strMsg
strMsg = "The answer is " & "$" & Sqr(ABSumTotal) & "."
MsgBox strMsg
End Sub
沒有變量聲明此爲整,但它仍然工作得很好。爲什麼這樣?
啊哈,我明白了。謝謝。 – brilliant 2009-11-12 00:42:03