Hi all,

This might be a little difficult to describe but I have created multiple UDFs to make custom labels for graphs, its basic function is to grab the value(mostly a percentage) in a cell and then concatenate it with the count by grabbing the numerator of the formula in the previously mentioned cell and evaluating it, the output could look something like this : 50%(4000), I have this formula going across 3 sheets in my workbook. Unfortunately when I reopen the workbook the labels appear as 50%(0) and I have tried manually rebuilding the calculation tree with CTRL + ATL + Shift + F9 which calculates one worksheet correctly but when I move on to calculating the next worksheet it resets the previous one I just fixed. Does anyone have any insight on how I can fix this issue? Also keep in mind I have these formulas used literally hundreds of times so re-entering the formulas in each cell would be way too time consuming considering its deliverable date. I have attached my UDFs below. Thanks!

P.S. I am using Excel 2010

Function FT(MyCell As Range)
Application.Volatile (True)


    original = MyCell.Formula
    div = InStr(1, original, "/") - 1
    
If MyCell.Value = 0 Then
    FT = ""
ElseIf Left(original, 8) = "=IFERROR" Then
    FT = Evaluate("=" & Mid(original, 10, div - 10))
Else
    FT = Evaluate(Mid(original, 1, div))
End If


End Function

'******end of first function

Function labels(Percent)


Application.Volatile (True)


If Percent >= 0.01 Then
perct = Application.WorksheetFunction.Text(Percent, "##%")
Else
perct = Application.WorksheetFunction.Text(Percent, "0.##%")
End If


wrap = Chr(10)


Formula = FT(Percent.Cells)


If Percent = 0 Then
labels = ""
ElseIf Percent = "" Then
labels = ""
Else
labels = perct & wrap & "(" & Formula & ")"
End If


End Function