Hi Guys,
I'm trying to get text into an array and then use it to form the basis of a folder location but I keep getting a mismatch error.
So basically, I have a folder of files eg![]()
SourceFolder = Application.InputBox("Enter Source Folder Name. Make sure you do not have any spaces at the end of the line and make sure the line ends with a \ (backslash)", "Source Folder Name", Type:=2) ArraySource = Application.InputBox("Enter in the list of file numbers, make sure they are separated by commas", "Enter Comma Separated List", Type:=2) EditedArray = Split(Trim(ArraySource), ",") FloorPlans = Array(EditedArray) Naming = "Floor Plan" Extension = ".xls" For K = 0 To UBound(FloorPlans) fullpathname = SourceFolder + Naming + FloorPlans(K) + Extension Set SrcBook = Workbooks.Open(fullpathname, UpdateLinks:=0)
Floor Plan A001.xls
Floor Plan A002.xls
...
Floor Plan Z999.xls
And I want to selectively open and print a subset of files. So the first text input will take in the folder I'm after for example:
"C:\Temp\"
The second input will take in the numbers I want, for example,
A001, B003, C005
And I want it to generate the fullpath of "C:\Temp\Floor Plan A001.xls" so that Excel knows which file to open.
I'm not sure how to assign my variables so that I don't get a mismatch error.
Oh, the reason why I need to do it in this manner is because I need to open and print files in a specific order.
I didn't include the rest of the macro where it prints etc, but basically, I don't need the entire folder, I just need to print specific files from it in a specific order governed by the input.
Any ideas on how to do it?
Thanks!
J
Bookmarks