Functions, including User Defined Functions, cannot change the
formatting of a cell.
To do that you'd need an event macro in the worksheet or workbook code
module, e.g., Worksheet_Change, or Worksheet_Calculate.
If you post what you're trying to do, it would be easier to suggest a
solution.
In article ,
vbphil wrote:
I've written a VBA function that will be used on a worksheet as a worksheet
function. I want to modify the formatting of the cell that the function is
in. I haven't found any way that works. How do you reference the cell that
the formula is in and make changes to it?
|