I have set up the UDF below to put the last file saved date into the active cell; and I also want to change the cell format to "dd-mm-yyyy" but it does not change whatever I do.
Here is the simple UDF:
Function LastSavedDate() As Date ' I tried "As String" too.
lastSaved = FileDateTime(ActiveWorkbook.FullName)
LastSavedDate = lastSaved
ActiveCell.NumberFormat = "dd/mm/yyyy"
End Function
I have tried various permutations, searched online and tried ChatGPT but I cannot get it to work.
Help appreciated.
Henry
Here is the simple UDF:
Function LastSavedDate() As Date ' I tried "As String" too.
lastSaved = FileDateTime(ActiveWorkbook.FullName)
LastSavedDate = lastSaved
ActiveCell.NumberFormat = "dd/mm/yyyy"
End Function
I have tried various permutations, searched online and tried ChatGPT but I cannot get it to work.
Help appreciated.
Henry