I have a user defined function in Excel. It is called as a formula function from spreadsheet cells and works fine.
I\'d like the function to be able to change the ce
I tried the Evaluate method, which worked but immediately crashed (2007). The help mentions caching the address, so that's my approach - store the cell and color in a collection, then change the color after the calculation.
Dim colorCells As New Collection
Function UDF...
UDF =
color =
colorCells.Add (Application.Caller)
colorCells.Add (color)
End Function
Sub SetColor()
While colorCells.Count <> 0
colorCells(1).Interior.Color = colorCells(2)
colorCells.Remove (1)
colorCells.Remove (1)
Wend
End Sub
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
SetColor
End Sub