AmandaCatRuth
Board Regular
- Joined
- Apr 20, 2012
- Messages
- 79
Excel 2010
I have a macro that searches through network folders and opens the "tracker" files for jobs. These are just Excel files. The tracker is based around a 6 digit job number (ex: 120001). The actual file name will include the job number and other text (usually a company name) example: 120001 Bob's Company
The code tracks through a bunch of folders (my company has them organized oddly) and opens the file.
This works wonderfully...as long as there is only one file with that job number. 95% of the time, that's the case, but sometimes, I'll have two like this:
130001 Bob's Company
130001 Bob's Company (IRS)
In cases like these, ONLY the second file opens (the IRS one).
What I would like to do, at least, is open both files when this occurs.
Optimally (and I am not sure if this is possible), I'd like to have a pop-up box listing both file names, and allowing me to select whether to open one, the other, or both.
So, how do I do this?
Any help would be much appreciated.
I have a macro that searches through network folders and opens the "tracker" files for jobs. These are just Excel files. The tracker is based around a 6 digit job number (ex: 120001). The actual file name will include the job number and other text (usually a company name) example: 120001 Bob's Company
The code tracks through a bunch of folders (my company has them organized oddly) and opens the file.
Code:
SumPath = [path] & ProjFYear & " Project Info Files\" & YPath & "\"
TName = (ProjNum & "*" & ".xls")
TFile = Dir(SumPath & TName)
Tracker = SumPath & TFile
Application.EnableEvents = False
Workbooks.Open FileName:=SumPath & TFile
This works wonderfully...as long as there is only one file with that job number. 95% of the time, that's the case, but sometimes, I'll have two like this:
130001 Bob's Company
130001 Bob's Company (IRS)
In cases like these, ONLY the second file opens (the IRS one).
What I would like to do, at least, is open both files when this occurs.
Optimally (and I am not sure if this is possible), I'd like to have a pop-up box listing both file names, and allowing me to select whether to open one, the other, or both.
So, how do I do this?
Any help would be much appreciated.