WEBVTT

00:02.100 --> 00:02.850
Okay guys.

00:02.850 --> 00:04.130
And welcome back.

00:04.170 --> 00:08.700
Now in this one we're going to have a look at the complete code again and we'll just go through it as

00:08.700 --> 00:11.160
it executes and I'll talk you through what it does.

00:11.340 --> 00:16.410
But I want to draw your attention to this tab down here called sub folder structure.

00:16.560 --> 00:23.220
And what we have in here are the names of the for some folders that we want to create in the new folders

00:23.220 --> 00:26.450
that we're creating for companies a through age.

00:26.460 --> 00:34.950
So Company A will have these four new folders inside its folder as well Company B C all the way through

00:34.950 --> 00:36.050
to age.

00:36.060 --> 00:43.770
So this is the code we have for marable's we have my path and I'm just specified my pathway at the top

00:43.770 --> 00:49.320
here so that way if we ever have to change the path we just like change this line of code and we're

00:49.320 --> 00:49.830
golden.

00:49.830 --> 00:57.800
So in this instance it uses Allen desktop slice my folders back slash remember for this code to run

00:57.810 --> 01:00.310
your computer unless your name is Allen.

01:00.390 --> 01:03.940
You're going to have to change that to your path again.

01:04.230 --> 01:11.550
So that's our first one structure array struct array is an array that is going to hold the names of

01:11.640 --> 01:15.730
all of our sub fallers okay.

01:15.870 --> 01:21.450
We have full account which come in back here is going to be the count of the number of fallers which

01:21.450 --> 01:23.610
we need to know so we can read.

01:23.610 --> 01:28.030
I mentioned our array to whole exactly the right number of folders.

01:28.230 --> 01:34.350
Notice way at the top by the way that this is Option Explicit which is Surrey is Option Base 1 which

01:34.350 --> 01:36.660
forces our arrays to begin in number one.

01:36.660 --> 01:40.980
And so also Option Explicit So it forces variable declaration.

01:40.980 --> 01:46.210
So that's our folder count how many folders are we going to need to create in a subfolder loop.

01:46.230 --> 01:53.610
We'll ask just a loop so loop through to create each help the subfolder So let's just have f 8 through

01:53.610 --> 01:54.270
there.

01:54.360 --> 02:01.620
So this sheet here as a v.b. name of s.h. a fairly strict doxil X we're already slated for the count.

02:01.620 --> 02:09.300
We're going to use that range range one to one app and Excel down dont count and we can see that that

02:09.300 --> 02:15.510
is for now we know that we have for fall this or for some fallers we're going to read I mention our

02:15.510 --> 02:19.530
array to match that number falder can't f 8.

02:19.740 --> 02:26.490
So our air array is now set up with four elements so one each for each of these four things.

02:26.500 --> 02:31.740
Now we're just going to loop through the subfolder flow from one two fold account and we're going to

02:31.740 --> 02:41.310
load in two on the first iteration subfolder loop one the cells subfolder loop one dark blue which is

02:41.460 --> 02:42.920
1 1.

02:43.080 --> 02:44.470
So it's going to be this cell.

02:44.490 --> 02:51.960
And then when I loop through again it's going to be two one kisses wrote to melkus of valda loop is

02:51.960 --> 02:53.750
now in its second iteration.

02:53.940 --> 02:55.170
Bump bump bump bump bump.

02:55.200 --> 03:01.860
And may we have invoices NRA position one pair of swords in two credit notes in three and other stuff

03:01.920 --> 03:04.750
in for sheer index stock.

03:04.750 --> 03:07.860
Select back over to here B for select.

03:07.860 --> 03:09.870
This is all looking very familiar.

03:09.870 --> 03:15.550
This code up to this point is identical to the code that we've just created.

03:15.630 --> 03:22.960
Other than the fact that I now have my path and the active cell to the left so make directory my path.

03:22.980 --> 03:28.100
I'll live through I'll I'll live through it once and then we'll have a look at it in action.

03:28.170 --> 03:34.530
So now we're going to go through the sub folder loop and this is in a loop inside the wide at outer

03:34.530 --> 03:38.790
loop so we have a while when glued on the outside and inside.

03:38.790 --> 03:44.700
Once you've created that folder we go through the same routine but we'll go through it four times because

03:44.700 --> 03:45.830
we have four fold.

03:45.840 --> 03:48.990
So again we're going to use the same structure we're going to loop through.

03:48.990 --> 03:50.450
When I hit effort eight.

03:50.500 --> 03:57.640
When I hit her fate so so fall the loop is going to be number one on the first pass through a match

03:57.640 --> 04:03.600
it's going to pull structure array number one which holds the name of affairs subfolder.

04:03.930 --> 04:05.850
So the path is exactly the same.

04:05.850 --> 04:07.660
It's still mkr STILL THE I.

04:07.680 --> 04:14.880
Ah but it's now looking inside its parent folder which is company a name a second pass through that

04:14.880 --> 04:24.210
loop structure array will be worth two so it's going to return a second subfolder 3 4 and then down

04:24.210 --> 04:27.380
to here and then loop through again and again.

04:27.480 --> 04:28.780
Okay now wait a minute.

04:28.820 --> 04:29.760
Do.

04:29.940 --> 04:34.470
And stop that and then expand this window.

04:35.730 --> 04:41.070
I'm going to bring up that valeri event and find if they're moved just one second my folders are deleted

04:41.070 --> 04:42.420
what we've already done.

04:42.640 --> 04:46.080
And you still can't see a second leg NASA.

04:46.090 --> 04:52.740
So now gula delete these killers we're optically interesting when these eye blinks again to be Schiff's

04:52.830 --> 04:53.400
cells left.

04:53.400 --> 04:53.990
Whichever.

04:54.160 --> 05:00.360
Okay so now we have companies a b c d through to h with some fat for a sub folder structure invoice

05:00.390 --> 05:04.880
poacher's crane notes and other stuff that we want to appear in each of these.

05:04.890 --> 05:07.070
This is the directory we are looking at.

05:07.100 --> 05:08.470
Let's just hit the button.

05:08.730 --> 05:15.400
So there go all of our hyperlinks here are all about folders in my cloete company.

05:15.590 --> 05:19.380
You see we have a fault of afren notes invoices of the suffern pay its orders.

05:19.410 --> 05:23.150
Obviously these are alphabetical company B exactly the same thing.

05:23.160 --> 05:25.620
And on and on and on and there you go.

05:25.800 --> 05:31.480
You've just created a complete directory structure including some folders.

05:31.680 --> 05:34.270
Okay I'll see you in the next line Jeff.
