我有一个VBA函数:如何获得当前的Excel单元格
public function MyFunction(someParameters) as Double
... do something ...
return aValue
end function
我有一个在我的函数是从一些细胞称为表:
A1: =MyFunction(...)
A2: =MyFunction(...)
A100: =MyFunction(..)
我想返回价值(它的工作原理),也可以添加注释到单元格...
如果我使用ActiveCell
然后我使用AddComment
,它添加注释到最后一个单元格离开我的游标,而不是'活动单元格计算”。
怎么办?
谢谢。
您可以参考它调用UDF的细胞 - 我还没有尝试过,对于添加注释,虽然。 http://www.mrexcel.com/forum/excel-questions/379635-get-cell-reference-udf-caller.html – natancodes