I have a user function as follows that doesn't work: Function FORMAT8_I(Cells_Dat As Integer) As String FORMAT8_I = Right(" " & Format(Cells_Dat, "0"), 8) End Function When I change the Cells_Dat as a Long it work fine. I tried to debug the problem but it appears that when I have the original code above the cell that activates the function doesn't even go to the VBA function. It simple outputs a #NUM! error.
Solved by O. J. in 23 mins