switching workbooks using variable and wilcard filename
On Sep 28, 4:21*pm, Don Guillett wrote:
I would think you may have to use DIR *to loop thru the folder until
you find the right file
if left(fn,6)="203416" & instr(fn,"Enzyme")0 then
On Sep 28, 9:53*am, SS wrote:
Hi,
Any help would be appreicated...
I have a file open named:
203416 SS Mean Enzyme Activity Template.xls
Then i open another file with all the vba.
The operation in question needs to switch to the above file, but i
only know the first six digit number, and can't be sure of anything
else, except that it has the word Enzyme.
The six digit number has already been defined as variable req1
so, in my file with macros, i try to switch to the correct open
workbook using only req1 and Enzyme, but this doesn't work:
Windows((req1) & "*Enzyme*.xls").Activate
This does work, but i can't count on anything but the req1 number and
Enzyme to be there every time:
Windows((req1) & " SS Mean Enzyme Activity Template.xls").Activate
I think it's just syntax...
Thanks for any help,
Steve- Hide quoted text -
- Show quoted text -
Sorry, this is probably so simple...
The thing is, the file will be currently open, just need to switch to
it, address it, copy from it, etc. But, I don't know the full name of
the workbook. I only have two pieces of the filename (workbook name).
I think i just need the way to syntax this type of thing (everything
between workbook and activate):
Workbook.((predefined variable) + WILDCARD (ANY TEXT) + "Enzyme" +
WILDCARD (ANY TEXT) + ".xls").Activate
Does my original question make more sense?
Thanks for the help,
Steve
|