Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom
"Tom Ogilvy" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
You will need a loop ... This VBA code should be useful for your problem (with a little modification :)): http://www.exceltip.com/st/List_file...Excel/446.html -- http://blog.jausovec.net "Andibevan" je napisal: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pulling pdf files from general folder to specific folder | Excel Discussion (Misc queries) | |||
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? | Excel Discussion (Misc queries) | |||
Need code to save file to new folder, erase from old folder | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
I deleted 99% of data from excel file. Folder Size remains unchang | Excel Discussion (Misc queries) |