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!
Bookmarks