Thread: Folder Size
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Folder Size

Function ShowFolderSize(filespec)
Dim fso, f, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(filespec)
s = UCase(f.Name) & " uses " & f.size & " bytes."
ShowFolderSize = s
End Function


usage:

? Showfoldersize("C:\Data6")
DATA6 uses 28409904 bytes.


--
Regards,
Tom Ogilvy




"Andibevan" wrote in message
...
Hi All,

I am trying to build a function that will output the total size (including
sub-folders) of a directory?

Is there a way of easily returning this information or would a loop be
required?

Ta

Andi