ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   count subfolders (https://www.excelbanter.com/excel-programming/435585-count-subfolders.html)

peter

count subfolders
 
Hi,
The properties of a windows folder gives you file size on disk, file count,
and folder count.
I need a vba to extract that info.
Any ideas???

peter
(nested folders and files included)

joel[_125_]

count subfolders
 

Sub GetFolderInfo()

strFolder = "C:\temp"

Set fso = CreateObject _
("Scripting.FileSystemObject")
Set folder = _
fso.GetFolder(strFolder)


FolderSize = folder.Size
Files = folder.Files.Count
Subfolders = folder.Subfolders.Count
Size = folder.Size
End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=149288



All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com