hi Paul,

i am getting bug here,

ub List_Folder_Size()
    Dim fso, fldr, sfldr, FolderName
    Dim Sht, R
    FolderName = "D:\C-backup"
    Sht = "FolderList"

    Set fso = CreateObject("Scripting.FileSystemObject")

    Sheets(Sht).Range("A2:Z65000").ClearContents


this yellow highlighted one i am getting bug.

Please can you help me in this concern.

Thanks,
Raj
On Fri, Oct 14, 2011 at 8:51 PM, Paul Schreiner <schreiner_p...@att.net>wrote:

> This should do it.
>
> Sub List_Folder_Size()
>     Dim fso, fldr, sfldr, FolderName
>     Dim Sht, R
>     FolderName = "C:\temp\"
>     Sht = "FolderList"
>
>     Set fso = CreateObject("Scripting.FileSystemObject")
>
>     Sheets(Sht).Range("A2:Z65000").ClearContents
>     R = 1
>     If (fso.folderexists(FolderName)) Then
>         Set fldr = fso.getfolder(FolderName)
>         For Each sfldr In fldr.subfolders
>             R = R + 1
>             Sheets(Sht).Cells(R, "A").Value = sfldr.Name
>             Sheets(Sht).Cells(R, "B").Value = sfldr.Size
>         Next
>     End If
>     MsgBox "Done"
> End Sub
>
>
>
> *Paul*
>
> -----------------------------------------
> *“Do all the good you can,
> By all the means you can,
> In all the ways you can,
> In all the places you can,
> At all the times you can,
> To all the people you can,
> As long as ever you can.” - John Wesley
> *-----------------------------------------
>
>
>  ------------------------------
> *From:* Rajasekhar Praharaju <rajasekhar.prahar...@gmail.com>
> *To:* excel-macros@googlegroups.com
> *Sent:* Fri, October 14, 2011 11:18:13 AM
> *Subject:* Re: $$Excel-Macros$$ Need help
>
> Hi Paul,
>
> Thanks for your quick reply, Only the first sub folder names and their
> respective sizes.
>
> Thanks,
> Raj
>
> On Fri, Oct 14, 2011 at 8:45 PM, Paul Schreiner <schreiner_p...@att.net>wrote:
>
>>   are you wanting all sub-folders within the folder?
>> or do you want to progress down through all the nested sub-folders?
>>
>>
>> *Paul*
>>
>> -----------------------------------------
>> *“Do all the good you can,
>> By all the means you can,
>> In all the ways you can,
>> In all the places you can,
>> At all the times you can,
>> To all the people you can,
>> As long as ever you can.” - John Wesley
>> *-----------------------------------------
>>
>>
>>  ------------------------------
>> *From:* Rajasekhar Praharaju <rajasekhar.prahar...@gmail.com>
>> *To:* excel-macros@googlegroups.com
>> *Sent:* Fri, October 14, 2011 11:11:22 AM
>> *Subject:* $$Excel-Macros$$ Need help
>>
>> Good evening experts,
>>
>> Please assist me in this concern i am  looking for a excel macro which can
>> give details of  folders and their respective size.
>>
>> for example  i have Main folder with name Excel with in the folder i have
>> many other sub folders, so i am looking for a macro which can list the sub
>> folders names and their respective sizes.
>>
>> Thanks for your help in advance.
>>
>> --
>> --
>> Thanks & Regards,
>> Rajasekhar.P
>>
>>
>> --
>>
>> ----------------------------------------------------------------------------------
>> Some important links for excel users:
>> 1. Follow us on TWITTER for tips tricks and links :
>> http://twitter.com/exceldailytip
>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> <><><><><><><><><><><><><><><><><><><><><><>
>> Like our page on facebook , Just follow below link
>> http://www.facebook.com/discussexcel
>>
>> --
>>
>> ----------------------------------------------------------------------------------
>> Some important links for excel users:
>> 1. Follow us on TWITTER for tips tricks and links :
>> http://twitter.com/exceldailytip
>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> <><><><><><><><><><><><><><><><><><><><><><>
>> Like our page on facebook , Just follow below link
>> http://www.facebook.com/discussexcel
>>
>
>
>
> --
> --
> Thanks & Regards,
> Rajasekhar.P
>
> Subscribe to our group and receive daily updates.
> Excel groups
>
> https://sites.google.com/site/excelencyclopedia/how-to-join/assignments
>
> Send your queries and Suggestions @
> excel-gro...@googglegroups.com
>
> Excelforum Blogspot
>
> <a href="
> http://feedburner.google.com/fb/a/mailverify?uri=ExcelForum&amp;loc=en_US<http://feedburner.google.com/fb/a/mailverify?uri=ExcelForum&loc=en_US>">Subscribe
> to excel forum by Email</a>
>
>
>
> --
>
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links :
> http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><><><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
>
> --
>
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links :
> http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><><><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
>



-- 
-- 
Thanks & Regards,
Rajasekhar.P

Subscribe to our group and receive daily updates.
Excel groups

https://sites.google.com/site/excelencyclopedia/how-to-join/assignments

Send your queries and Suggestions @
excel-gro...@googglegroups.com

Excelforum Blogspot

<a href="
http://feedburner.google.com/fb/a/mailverify?uri=ExcelForum&amp;loc=en_US<http://feedburner.google.com/fb/a/mailverify?uri=ExcelForum&loc=en_US>">Subscribe
to excel forum by Email</a>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to