|Please click on the blue line at the end of this post and read the instructions on how to post VBA code in this forum. By using the pre tags, you will be able to retain the indentation of the code and make it easier for us to follow.|
May I also suggest that you clean up your code to make it both easier to read and more efficient. For example, it is rarely required that you Select a cell within VBA in order to perform and action on it.
For example, these instructions...
ActiveCell.FormulaR1C1 = "My Comments"
ActiveCell.FormulaR1C1 = "Final Decision"
ActiveCell.FormulaR1C1 = "Opportunity"
...can (should) be written as:
Range("P1") = "My Comments"
Range("Q1") = "Final Decision"
Range("R1") = "Opportunity"
Without reviewing your code in it's entirety, I'm fairly confident in saying that you can probably eliminate every instance of .Select and condense multiple lines of code into a single instruction.
That said, I'm not 100% sure that I understand your question:
Is it possible to add to the below macro to add the vloopkup to the columns listed above that references a sheet that doesnt exist at the beginning of the month but will in the second week?
Are you looking for VBA code that will allow you construct a VLOOKUP formula that references a non-existent workbook without it causing an error, then when the workbook is created, it will return the desired value? e.g., in English:
"If MyFile does not exist, return a blank cell but if MyFile does exist, perform a VLOOKUP referencing that file."
Am I close?
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.