Sub GetDate()
Dim oFS As Object
Dim strFilename As String
'Put your filename here
strFilename = "I:\Interfund Transfers\Interfund Transfer.xlsx"
'This creates an instance of the MS Scripting Runtime FileSystemObject class
Set oFS = CreateObject("Scripting.FileSystemObject")
MsgBox strFilename & " was created on " & oFS.GetFile(strFilename).DateCreated & " was last modified on " & oFS.GetFile(strFilename).Datelastmodified
Set oFS = Nothing
End Sub
Sub GetDate()
Dim oFS As Object
Dim strFilename As String
'Put your filename here
strFilename = "I:\Interfund Transfers\Interfund Transfer.xlsx"
'This creates an instance of the MS Scripting Runtime FileSystemObject class
Set oFS = CreateObject("Scripting.FileSystemObject")
Cells(23, 4) = strFilename & " was created on " & oFS.GetFile(strFilename).DateCreated & " was last modified on " & oFS.GetFile(strFilename).Datelastmodified
Set oFS = Nothing
End Sub
Sub GetDate()
Dim oFS As Object
Dim strFilename As String
'Put your filename here
strFilename = "I:\Interfund Transfers\Interfund Transfer.xlsx"
'This creates an instance of the MS Scripting Runtime FileSystemObject class
Set oFS = CreateObject("Scripting.FileSystemObject")
Cells(23, 4) = oFS.GetFile(strFilename).Datelastmodified
Set oFS = Nothing
End Sub
Sub GetDate()
Dim FSO As Object
Dim SourceFolder As String
Dim FileName As String
Dim Ws As Worksheet
Dim LR As Long
Set Ws = Worksheets("Sheet1")
LR = Ws.Range("B" & Rows.Count).End(xlUp).Row
SourceFolder = Ws.Range("B4").Value
Set FSO = CreateObject("Scripting.FileSystemObject")
FileName = SourceFolder & Ws.Range("B6").Value
Ws.Cells(8, 2) = FSO.GetFile(FileName).Datelastmodified
Set FSO = Nothing
If Ws.Cells(8, 2).Value = Ws.Cells(12, 2).Value Then
Ws.Cells(12, 2).Value = Ws.Cells(8, 2).Value
Ws.Range("A12:A" & LR).FormulaR1C1 = "=MAX(R11C1:R[-1]C)+1"
Ws.Range("A12:A" & LR).Value = Ws.Range("A12:A" & LR).Value
Else
Ws.Cells(12, 2).EntireRow.Insert Shift:=xlDown
Ws.Cells(12, 2).Value = Ws.Cells(8, 2).Value
Ws.Range("A12:A" & LR + 1).FormulaR1C1 = "=MAX(R11C1:R[-1]C)+1"
Ws.Range("A12:A" & LR + 1).Value = Ws.Range("A12:A" & LR + 1).Value
End If
Ws.Range("A10").Select
End Sub
Please find attached for your reference.Sub CheckInterfundTransferDate()
'
' MacrCheckInterfundTransferDateo2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+C
Worksheets("Start Here").Range("D23") = FileDateTime("I:\Interfund Transfers\Interfund Transfer.xlsx")
End Sub
If that's not the way it looks, and you can't get it to work, copy and paste the macro you created.
Worksheets("Start Here").Range("D23") = FileDateTime("I:\Interfund
:)