We're going to work through a pretty sophisticated example here in this screen cast. In the folder called sample files.zip on the course website. I'm going to be working with those five files again. So I've got these five files. They each have different things in cell A 1. And what we're going to do in this screen cast is we're going to import all of the strings in cell A 1 from those five workbooks. So I'm going to close all those other workbooks, other than the one that I'm working with. This is my main file just so I don't get confused. So what I'm going to do into I guess these five rows, I'm going to bring in the five strings that were in range A 1 of those five workbooks. We're going to create a vector to do this. So let's go ahead and get started. Created a sub here. I've Dimmed file names as a variant. This is going to be the vector of file names that the user is going to select using a GetOpenFileName. I've also Dimmed nw as an integer that's going to be the number of workbooks. I is going to be an integer that we iterate over. We're then going to get the file names using application GetOpenFileName. See the previous screen cast on opening workbooks for all the information about this. But we're allowing the multiselect, so the user can select multiple workbooks. I'm then counting the number of workbooks using upper bound or file names. And now we're going to do is one at a time, we're going to open up each of those workbooks that the user selects using the GetOpenFileName method here. And this is where we're going to open up a file, we going to take in whatever is in cell A 1 put that into the ith element of a vector which we need to Dim. So I've Dim that vector as A, it's just going to be a vector of strings. If you wanted this to be amendable to numbers and such, you could make this a variant. We need to resize or ReDim A once we know the size. So I've ReDimmed A size nw. I'm also going to use option base 1 because I'm working with vectors. So now we're ready to open up each file one at a time and import the element of range A 1 into A. So we're going to open up the ith FileName and what I'm going to do just to eliminate confusion is I'm going to use this active workbook and I'm going to set that. I need to Dim aWB as a workbook. I'm also just to avoid confusion, I'm going to set this workbook earlier too so that we can easily go back and forth and we don't have any confusion. So I've Dimmed tWB and aWB both as worksheets. The first line here I'm just going to set tWB equals ThisWorkbook. And then once we open up each of the files one at a time, we're going to set that ActiveWorkbook to this variable aWB. And then I'm going to set the ith element of the A vector equal to the aWB.Sheets Sheet 1. So we're always taking range A 1 of Sheet 1 and putting that into the ith element of A. So we keep iterating for i equals 1 to the number of workbooks each time opening, setting the active workbook name and so on. And just in case we have other workbooks open, again I like to avoid confusion, I'm just going to activate this workbook. Now this probably won't matter too much if we leave these out, but it's just a good idea to do like to get in the habit of working and activating different workbooks so we don't have any confusion. And the last thing we need to do now is in range A 3 through A 7 in this case. And in general, that's going to be A 3 to A nw plus 2. So if we had different number of workbooks like 10 of them, then we would go A 3 to A 12. We're going to set that equal to the WorksheetFunction.Transpose of A. A is a row vector, so we're just going to transpose that and place it into cells A 3 to A 7 in this case. One thing I forgot to do is inside each for loop, we need to close the workbooks. To close a workbook, we can just do aWB.Close SaveChanges equals false. So we disregard any changes that will be made. And we keep going and going and we output that. And this should be ready to go. So I'm going to put a breakpoint here at the end just so we can kind of see what the A vector is right before we output it. I'm going to press F5 to run through. The user selects the files file 1 through 5 in this case, we open those up. And one thing I put on here that I forgot to mention is I put this Application.ScreenUpdating equals false. When you do that, if you don't have that then you can see the editor opening up each file and closing it. And so that's not very professional. It's better if you can just turn that screen updating off to set it to false. It's also a little bit faster and all you see is the end result. So what we've done is we've gone through, we've opened up all those files. We've extracted the range A 1 from each of those and placed them into this A vector down here. And so it looks like it's working. The last thing we need to do is just output this to this workbook and I press F 8 and we output that to range A 3 to A 7. And then we end this up. So, this sort of shows you how we can import data from multiple workbooks and consolidate that information into a single workbook. Thanks for watching.