Hi
I was trying to use two UDF's that I found as I read the Excel 2007 Mr Excel book. I am a little confused at how I use the output of one function in another.
This is the code largely adapted from the book, I think its chapter 4(not sure book at home).
Essentially the first function is supposed to place the fullpath and filename of the current workbook in a cell. I then want to use this full path name in another function to check the last save date. As the paths may change I want to use the returned result of the first function so that no matter where a user saves the file the last saved date can be checked.
I was trying to use two UDF's that I found as I read the Excel 2007 Mr Excel book. I am a little confused at how I use the output of one function in another.
This is the code largely adapted from the book, I think its chapter 4(not sure book at home).
Essentially the first function is supposed to place the fullpath and filename of the current workbook in a cell. I then want to use this full path name in another function to check the last save date. As the paths may change I want to use the returned result of the first function so that no matter where a user saves the file the last saved date can be checked.
Code:
Function MyFullName() As String
' Write the name of the full worksheet address in a cell
MyFullName = Worksheets("ServiceDeliveryTemplate").Cells(A, 25).FullName
End Function
Function Lastsaved("MyFullName") As String
' retrieve full path from MyFullName Function and retrieve last save date.
Lastsaved = FileDateTime(MyFullName)
End Function