我想在数字(35,该值来自索引匹配查找)和分数(分数在Excel工作表单元格中,格式为General)之间进行乘法。可悲的是,当我执行代码时,似乎将小数取整为1或0,具体取决于小数=> 0.5。这是一个示例代码:
dim indexmatchresult as variant 'a number, e.g. 35, comes from application.index etc.
dim cell as range
dim fraction as long
fraction = cell.value 'it's a number, like 0.43
indexmatchresult = indexmatchresult.value * fraction
数据类型是否有问题(我怀疑是变量类型)?