I'm trying to make it so that my UDF function updates whenever its reference cells update.
Here's the code:
Function ConCatRange(CellBlock As Range) As String Application.Volatile True Dim cell As Range Dim sbuf As String For Each cell In CellBlock On Error GoTo fred If Len(cell.Text) > 1 Then sbuf = sbuf & cell.Text & Chr(10) Next ConCatRange = Left(sbuf, Len(sbuf) - 1) fred: End Function When reference cells are blank, however, it will not show #VALUE! - This is what I want. Instead, it will just not update and keep the data that was last populating the cell.
Thank you!
Application.Volatileis unnecessary. The UDF will update whenever the referenced cells are updated; and having that there will force it to recalculate unneccesarily.