0
dim g as int, i as string
range("a1").value = i 
g = 10
range("b1").value = i + g 

让 A1 = 1 预期 B1 = 11 但它是 10

4

2 回答 2

1
dim g as int, i as string
i = range("a1").value 'assuming that A1 contains 1
g = 10
range("b1").value = i + g 

第二行分配是错误的方式

翅膀

于 2013-07-08T10:40:27.290 回答
1

由于 i as String var ("1"),它应该是 ..

range("b1").value = val(i) + g 
于 2013-07-08T10:43:12.797 回答