![Excel VBA:如何从公共函数更改单元格对齐方式](https://linux22.com/image/1645090/Excel%20VBA%EF%BC%9A%E5%A6%82%E4%BD%95%E4%BB%8E%E5%85%AC%E5%85%B1%E5%87%BD%E6%95%B0%E6%9B%B4%E6%94%B9%E5%8D%95%E5%85%83%E6%A0%BC%E5%AF%B9%E9%BD%90%E6%96%B9%E5%BC%8F.png)
如何编写 UDF 或公共函数,同时更改调用它的单元格的布局?更具体地说:启用 WrapText,因为我的函数生成了大量文本。
我尝试了很多种变化来Application.Caller, .Address, ...
制作.WrapText = True
。但是都没有成功。
例子:
Public Function (X as integer, Y as integer) as integer
Dim Z as integer
Z = X + Y
- insert suggested code to make .WrapText from cell true -
End Function