Hi Guys!
I'm sure this isn't an uncommon situation but here goes nothing:
I'm trying to write a code that will open different files in a directory (different names based on quarters), open the pivot table and pull the data from there. I have all the correct code to grab the data, but I want to consolidate all 4 of the scenarios. It works when the file is available in the directory, but in the event it's not there, I'm stuck.
My question: what do I do inside the code to say if "2016Q1Q2.xlsb" doesn't exist, go to the "2016Q3Q4.xlsb" - and if that doesn't exist then End Sub? I don't want to end up with the error message.
Thank you in advance!
Bookmarks