By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

expertatexcel.com

 


User Defined Functions

Using VBA I created a user function that returned the date/time of a file and the size.

=getstats(filename)

A
B
C
D
1C:\file.txt=GetStats(A1)3/17/2020 8:00 - 145,092
2C:\file2.xls=GetStats(A2)3/22/2020 8:52 - 3,233,028
3
4
5



Function Getstats(s)
Getstats = format(FileDateTime(s), "mm/dd/yyyy hh:mm") & " - " & format(FileLen(s), "#,
  • 0")
    end function



  •