Range.Formula returns a string that uses cell reference, why?

I am having a problem with `Range.Formula`. The code snippet is below (assume Range object has been created and is not null) string formula; formula = Range.Formula;//it returns whatever is written in the formula, even the cell reference Let's say I have such a formula, `=MyCalc(41, A1)`, that uses the relative cell reference. And in cell A1, there's a value, 100. So the value of the string variable `formula`, is always `=MyCalc(41, A1)` instead of `=MyCalc(41, 100)` which is the result I wanted. I wonder if there's a way to let Range.Formula avoid returning cell reference. Any ideas? Thanks
Doesn't this come down to magical thinking - that you want it to do some evaluation of the formula, and substitute the referenced cell values, but not evaluate the complete formula (e.g. invoke MyCalc and just give you the result)? Why would you expect it to do this?

以上就是Range.Formula returns a string that uses cell reference, why?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » excel

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准