Previous date in workbook

Closed
abhi - Mar 1, 2010 at 04:20 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 1, 2010 at 08:18 AM
Hello,
i am Abhi

I realy thanks to you for all grate solutions,

I have a proble defination that,

1) I am having cell which shows date of workbook is created or modified in text form

2) i want to see the previous date on sheet, when report was last modified

E.g.

Date: 8/25/2008 10:11:54 AM -( value is in Cell ( 29,1)
Previous Report Date: 8/10/2008 10:11:54 AM -( value is in Cell ( 29,2)



can you provide a MACRO for this problem suited for Excel2003


thanks
abhi

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 1, 2010 at 08:18 AM
Are you looking for last modified date or one date even earlier than that (last, last modified date). Properties can only give you creation and last modified time and not a time in between


Public Function getDocProp(propName As String)

    On Error GoTo ERR_HNDL
    
        GetDocProp = ActiveWorkbook.BuiltinDocumentProperties(propName)
        Exit Function

ERR_HNDL:
    GetDocProp = "Error"
    Exit Function

End Function



for last modified date : property name is Last Save Time
for creation date: property name is Creation Date

you can call the function in your sheet as
=getDocProp("Last Save Time") for last modified time

and
=getDocProp("Creation Date ") for creation time
0