Results 1 to 2 of 2

How to get file size from a given folder as input and categorize the files based on size

Threaded View

mahendra.asapu How to get file size from a... 05-27-2015, 05:27 PM
protonLeah Re: How to get file size from... 05-27-2015, 05:49 PM
  1. #1
    Registered User
    Join Date
    02-23-2014
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    60

    How to get file size from a given folder as input and categorize the files based on size

    Greetings to Excel Forum Team!

    Please let me know if any one has a functional solution for below problem statement

    Problem Statement: How to get file size from a given folder as input and categorize the files based on size and display them in sheet1

    Is it possible to have function to get file size from a directory chosen

    For example if I have selected directory as (c:\test\)

    c:test directory / root folder contains following files

    ------------------------------------------

    SZZ-DataSet-BIData1.dat File size: 20 MB

    MQQ-DataSet-BIData2.dat File size: 5 MB

    MQQ-DataSet-BIData3.dat File size: 0 KB

    TIK-DataSet-BIData3.dat File size: 9 MB

    TIK-DataSet-BIData3.dat File size: 300 MB

    RWR-DataSet-BIData2.dat File size: 105 MB

    PLM-DataSet-BIData1.dat File size: 1 KB

    PLM-DataSet-BIData2.dat File size: 10 KB

    please note, if there are any sub folders or directories with in the (c:\test\) the function should just ignore the sub folders or sub directories.

    ------------------------------------------

    When we call above function, need to filter files based on condition like below with Function call back
    Select 
    
    	Case FileSize GreaterThan 0 KB and LessThan 100MB
    		display this file name or file names and size in worksheet1 in two columns (File Name and File Size)
    
    	Case FileSize GreaterThan 100 MB
    		msgbox: RWR-DataSet-BIData2.dat & TIK-DataSet-BIData3.dat file size are greater than 100 MB.
    
    	Case FileSize Equal To 0 KB
    		msgbox: No data with 0 KB file/files
    
    End Select
    ------------------------------------------

    Appreciate any help with above need.
    Thank you!
    Last edited by Leith Ross; 05-27-2015 at 05:48 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 9
    Last Post: 05-18-2023, 07:18 PM
  2. Cycle through all .xlsb files in a folder in size order (largest first)
    By cochise in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2014, 08:33 AM
  3. Counting files in folder including subfolders also and folder size
    By mido609 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2012, 03:26 PM
  4. [SOLVED] Folder Size/File Count
    By DMc2004 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2006, 03:05 AM
  5. Getting number of files within a sub-folder and its size
    By Hari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2006, 01:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1