Free Excel VBA Macro Tutorial - Loop Through all folders, subfolders and files with size

preview_player
Показать описание
Free Excel VBA Macro tutorial - Loop Through all folders, subfolders and files with size via Excel - Loop till last folders and files and extract the details with size - youtube #youtubechannel #youtubevideo #vba #vbamacro #vbamacros #vbaenglish #vbafolders #vbafiles #vbafilesandfolders

welcome to technology platform so continuing the next session here so we discussed in the past sessions regarding how to capture the values in the cells and then how to use the functions we saw but our aim is to how to extract the files and subfolders and their size in the excel for example let me open so now i have here g in the technology platform folder i have so many folder inside so many files whether it is combination of powerpoint text document rtf file notepad file image folders and then in the so it is going on but how to so access or extract all the folders list and files names and their so if you want to see i want to click here i want to click here i want to click here to get what are the files present and what is the size so like that view wants to know but how to simplify the task by a macro we want to see that in the session now so now let's go to the session so this is our earlier sessions what i'm going to do here is like i'll just simply comment it and then so if you want to comment here we have seen so many options they have provided so this for my d back and everything's here so now what i'm going to do here is like just comment this everything and then we can do it now you can edit mode

i just used edit here now if you see here comment block let me show you one second i remove this so here if you see here anywhere so it's try to find out very difficult here so now right click here and debug this is for step into watch window everything has come over here the same thing edit window in this edit window i'm going to comment this by using this command block and then comment block so this one this one now i am going to comment this new functions i'm going to comment this so let me comment it full

and then create a news process sample

here first i want to select the folder like choose the folder to get all the subfolders and files for that we can give manually the path but instead of just for user friendly open the folder dialog box and then user can choose any other folder via browsing window for example let me go into set now see this

set is a keyword i'll put it like variable name called a folder okay fold related folder and then application these are all keywords now if you see application dot file dialogue so i'm selecting this one open here you could see folder picker open save us but we need a folder picker so i select folder picker i just close this the second step this is the variable now by using this variable i want to show here now you see this folder does show i'm going to run it effect mode now

fight f8 effect see this dialog box open here the user can choose any other whether g or h or c or d so that's user inputs not our input or that we are not hiding that we are just giving to the users options just closing this so instead of that we can try it like this so and removing this everything

you're getting black let's see application file file dialog and then show this will display

we want to call some functions and doing so many things because of that i use it in a variable so by using this variable i use it like set folder equal to this one

and then hold the dot show now the user has to select any one folder then only i will go further otherwise i should exit so because of that what i am going to do here is like if

then

exit x terminate the loop terminate the condition if there is no selection so for that it's up if folder show

is not selecting any one that means minus one i will use then exit don't want to call for example how do i say this like i will uncomment it

i'll say sample one

now we'll see call sample one so by using or by calling any other process we are using the keyword called call now see this am going to execute a f8

i'm not selecting i'm canceling it

it is not going to call sample1 now i will select any of the folder now see this technology platform i selected given okay now it come to call sample one and it start so because of because it is hidden because of that it is creating an issue it's fine so this is just for our understanding why i am giving this folder dot show not equal to one then exits up so i am just terminate the if nothing to be processed further because the user haven't selected anymore because of that we are using this then exit sum okay let me uncomment let me comment it okay now we selected this now what directory user has selected that i want to capture it now for that i am declaring available select dir select directory details same folder dot you can go here and see this application dot selected items so many things that title item created button name filters so many thing but i need selected items i need so
Рекомендации по теме