ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   INSERT FILEDATE INTO CELL COMMENT (https://www.excelbanter.com/excel-programming/441111-insert-filedate-into-cell-comment.html)

Simon

INSERT FILEDATE INTO CELL COMMENT
 
Hi
Can any one offer some code to insert the modified date of an external xls
file into a cell comment.
Thanks
Simon

Barb Reinhardt

INSERT FILEDATE INTO CELL COMMENT
 
This should get you started.

Sub test()
Dim myString As String

myString = ""
On Error Resume Next
myString = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
On Error GoTo 0
If Not myString = "" Then
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=myString
End If

End Sub

--
HTH,

Barb Reinhardt



"Simon" wrote:

Hi
Can any one offer some code to insert the modified date of an external xls
file into a cell comment.
Thanks
Simon


Rick Rothstein

INSERT FILEDATE INTO CELL COMMENT
 
Give something like this a try...

Dim LastModDateTime As Date, FilePathName As String
.......
.......
FilePathName = "C:\Users\Rick\Documents\Book1.xls"
LastModDateTime = FileDateTime(FilePathName)

--
Rick (MVP - Excel)



"Simon" wrote in message
...
Hi
Can any one offer some code to insert the modified date of an external xls
file into a cell comment.
Thanks
Simon



Simon

INSERT FILEDATE INTO CELL COMMENT
 
Thanks Barb
But does this looks like it places the date for the current workbook date. I
am looking to place the date of a completely seperate workbook.
Unless I misread this.
Thnaks
Simon

"Barb Reinhardt" wrote:

This should get you started.

Sub test()
Dim myString As String

myString = ""
On Error Resume Next
myString = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
On Error GoTo 0
If Not myString = "" Then
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=myString
End If

End Sub

--
HTH,

Barb Reinhardt



"Simon" wrote:

Hi
Can any one offer some code to insert the modified date of an external xls
file into a cell comment.
Thanks
Simon



All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com