我正在使用此宏来汇总单个单元格中用逗号分隔的单个数字
Function Individual(R As Range) As Double
Individual = Evaluate(Replace(R.Value, ",", "+"))
End Function
函数看起来像这样=个体(XY),其中XY是“源”单元格,其中写入了各个数字。
当“源”单元格为空时,如何修改宏以将0写入“目标”单元格?
答案 0 :(得分:0)
Function Individual(R As Range) As Double
if len(r.value) > 0 then
Individual = Evaluate(Replace(R.Value, ",", "+"))
else
Individual = 0
end if
End Function