UDF to show the expression of cell formula.

原创 2010年12月24日 13:49:00

With VBA, it's easy to show precedents of the cell :



But when we compile this as an UDF,it won't work in worksheet:

If we input a formula "=MyPrecedents(A1)" in [B1],it will show "$A$1" instead of "$B$2,$C$3,$D$9". It returns only the address of MyCell! I t is not passed to the function as an argument ,What's wrong with it?


Furthermore, if we need the expression with orign data, a feasible method is to use "Worksheet_Change" event subroutine instead. (See F36 of http://club.excelhome.net/viewthread.php?tid=663427&pid=4519978&page=4)



And after many tests,I found a way to use UDF at last.



相关文章推荐

How to show/hide a set of elements?

Question: 根据指定的属性选出一批结点,将它们的父结点隐藏。 dojo已经支持到css3的查询,但遗憾的是,没有父结点选择器(css3不支持父结点选择器),这一点似乎不如jQuery,据称...
  • yaaron
  • yaaron
  • 2011年10月02日 23:41
  • 425

使用POI导入Excel并解决Cannot get a text value from a numeric formula cell

最近做Excel导入 有两个方法:JXL 和POI 各有问题:JXL 导入:文件中有宏就报错,找不到解决方法。                     POI导入:文件太大造成内存溢出。 先说...

【转载】三种证明欧拉恒等式的方法(3 methods of proving Euler's Formula )

【转载】三种证明欧拉恒等式的方法(3 methods of proving Euler’s Formula )如下证明来自维基百科,本文属于转载如有版权涉及问题,概不负责。 These proofs...

The Secret Formula To Never Being Unemployed

The Secret Formula To Never Being Unemployed by Nick O'Neill While j...

ten ways to derive black scholes formula

  • 2009年07月16日 11:21
  • 291KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:UDF to show the expression of cell formula.
举报原因:
原因补充:

(最多只允许输入30个字)