Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting the date from my left footer
Hi,
Im trying to get the date from my left footer. The date in the footer will change over time. In the footer it looks like this. testBook.xls Revised 7/30/2009 Im using this code to get the information, but now I need a way to either put the last part of this string (the date) or something else that will get me there. textString = .LeftFooter This is the line I used to get "&8&Fļ”ļ*Revised 7/30/2009. (The square means return.) Im using office 2003. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting the date from my left footer
I believe that the revision date in the footer comes from:
ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") That is a date/time field, so you can format it according to how you want to use it (just date, etc) HTH, Keith "Still_learning" wrote: Hi, Im trying to get the date from my left footer. The date in the footer will change over time. In the footer it looks like this. testBook.xls Revised 7/30/2009 Im using this code to get the information, but now I need a way to either put the last part of this string (the date) or something else that will get me there. textString = .LeftFooter This is the line I used to get "&8&Fļ”ļ*Revised 7/30/2009. (The square means return.) Im using office 2003. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting the date from my left footer
Hi, Ker_01
Getting the revision date is not the problem. The date in the left foot is not automatically updated with the revision date. So, Im trying to make a trigger that will fire when saving or closing that will get the date from the left footer and then compare it with the BuiltinDocumentProperties("Last Save Time"). If no change than do nothing if different then update the left footer with the BuiltinDocumentProperties("Last Save Time"). "ker_01" wrote: I believe that the revision date in the footer comes from: ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") That is a date/time field, so you can format it according to how you want to use it (just date, etc) HTH, Keith "Still_learning" wrote: Hi, Im trying to get the date from my left footer. The date in the footer will change over time. In the footer it looks like this. testBook.xls Revised 7/30/2009 Im using this code to get the information, but now I need a way to either put the last part of this string (the date) or something else that will get me there. textString = .LeftFooter This is the line I used to get "&8&Fļ”ļ*Revised 7/30/2009. (The square means return.) Im using office 2003. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting the date from my left footer
Here what my code or the top part of my code look like.
Sub testFooter() Dim textString Dim dateString Dim testWord1 Dim testWord2 Dim testWord3 Dim fsMain Dim fsFile Dim revisedDate As Date Dim upDate Set fsMain = CreateObject("Scripting.FileSystemObject") Set fsFile = fsMain.GetFile(ActiveWorkbook.Path & "\" & ActiveWorkbook.Name) With ActiveWorkbook.ActiveSheet revisedDate = Format(CDate(fsFile.DateLastModified), "m/dd/yyyy") End With ' "&8&F" & Chr(10) & "Revised " & revisedDate testWord1 = Chr(10) & "SOA INTERNAL USE ONLY" testWord2 = Chr(10) & "CONFIDENTIAL" testWord3 = Chr(10) & "PUBLIC" With ActiveSheet.PageSetup textString = .LeftFooter If textString = "&8&F" & Chr(10) & "Revised " & revisedDate Then upDate = "stop" Else upDate = "go" End If I found that this will work but i'm still building on it. "Still_learning" wrote: Hi, Ker_01 Getting the revision date is not the problem. The date in the left foot is not automatically updated with the revision date. So, Im trying to make a trigger that will fire when saving or closing that will get the date from the left footer and then compare it with the BuiltinDocumentProperties("Last Save Time"). If no change than do nothing if different then update the left footer with the BuiltinDocumentProperties("Last Save Time"). "ker_01" wrote: I believe that the revision date in the footer comes from: ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") That is a date/time field, so you can format it according to how you want to use it (just date, etc) HTH, Keith "Still_learning" wrote: Hi, Im trying to get the date from my left footer. The date in the footer will change over time. In the footer it looks like this. testBook.xls Revised 7/30/2009 Im using this code to get the information, but now I need a way to either put the last part of this string (the date) or something else that will get me there. textString = .LeftFooter This is the line I used to get "&8&Fļ”ļ*Revised 7/30/2009. (The square means return.) Im using office 2003. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I create a text on the left or right like a header & footer | Excel Discussion (Misc queries) | |||
Want to use left and center footer in same page | Charts and Charting in Excel | |||
Want to use left and center footer on same page | Excel Discussion (Misc queries) | |||
Align Right footer text to Left | Excel Programming | |||
Left/Right Margins in Header/Footer | Excel Discussion (Misc queries) |