First off this is my first post so "Hello World" (of vba help), sorry I won't tell anymore bad jokes, promise. Anyway I am just starting out in vba but am making a simple program to open a directory and copy and paste columns to a new workbook. The code executes a full loop where the line in question is skipped by conditions in an if statement, everything works fine. The second iteration goes to the problematic range line in my if statement and i get the run-time error '1004' application-defined or object-defined error window. I think this has to be referencing the object range but I can't figure out why it isn't working. I have copied the code line that gives the error and put into a new sub by itself and it runs perfectly fine.
This is the range code line that gives the error:
its a pretty straight forward selection of a cell to the right of the last used cell. I am guessing the error has something to do with the objects being declared in my program but I can't figure it out. It has really been puzzling me so I hope you guys and gals can help! Here is the full code (took out my working path in the filesystem object and replaced it with the word path for privacy reasons):
Thanks and I hope someone can help!!