![]() |
Test Date of External Data Source
Just add quotes before the variable and the the &. Do the same thing after
the variable. See below: ActiveCell.FormulaR1C1 = "=IF(" & _ f.datelastmodified & "(TODAY()+0.99999),""Future Data?"",(IF(" & f.datelastmodified & "<TODAY(),""Old Data"",""Validated"")))" "RayportingMonkey" wrote: Yeah - I was able to make good use of it already... What I was not able to do was combine it into a formula in a maco, like: ActiveCell.FormulaR1C1 = "=IF(f.datelastmodified(TODAY()+0.99999),""Fu ture Data?"",(IF(f.datelastmodified<TODAY(),""Old Data"",""Validated"")))" How would I go about doing that? "Joel" wrote: The code actually produces a serial number date in the cell. Sub test1() Dim fs, f, f1, fc, s Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile("c:\temp\abc.txt") MsgBox (f.datelastmodified) Range("A1") = f.datelastmodified End Sub"RayportingMonkey" wrote: This works - But - Since I want to run logic in the worksheet based on this data, how do I redirect the response to a cell instead of a Message Box? "Joel" wrote: Sub test1() Dim fs, f Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFile("c:\temp\abc.txt") MsgBox (f.datelastmodified) End Sub "RayportingMonkey" wrote: I have created a number of automated reports in Excel and now need to pass the actual report generation on to a team of Analysts. There is a mix of automated and manual extracts that comprise the source for these reports. Is there a way I can test to see if the "Date Modified" for the source file(s) is = to TODAY? Thank you for your assistance! |
All times are GMT +1. The time now is 05:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com