I'm trying to get the .NumberFormat of a cell.
I tried putting the UDF both in the project where I'm using it and in my PERSONAL.XLSB.
I tried declaring them as both Function and Public Function, and neither are recognised. I get a #NAME? error.
The function, in PERSONAL.XLSB.
Public Function GetFormat(r As Range) As String
GetFormat = r.NumberFormat
End Function
I've gone through this page. I can't figure out what's missing.
EDIT: It works if I specify PERSONAL.XLSB!GetFormat, but I'd prefer to be able to call it with just the =GetFormat([CELL]) format.