Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open all .xls files in a target folder, run macro then next
On Sep 1, 11:18*pm, Patrick Molloy
wrote: If you want to process ALL the files in the folder, rather than selecting any yourself, let the code do it... filepath = "D:\root\child\*.xls" filename = DIR(filepath) DO WHILE filename < "" ' call your process ie your macro code filename = DIR() LOOP "Forgone" wrote: I've got a macro which I use at least 43 times a month and I'm wondering what would be the best way to automate it. Currently, I'm opening up each workbook manually, running the macro which does something, saves the document and closes it. *The only manual part is to open the workbook. Each month, these workbooks are located in a different folder (eg: for month) and I'm wondering what the best way to automate the "open workbook, call existing macro" for each workbook in a target folder. When the macro runs for the first time it would prompt the user for the 'target' folder and off it runs. The only thing is.... the folders change every month..... It's the filepath = "obtain from user which filepath to use" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open all .xls files in a target folder, run macro then next | Excel Programming | |||
User selection of folder and open all .xls files within folder | Excel Programming | |||
Excel macro to open files within a folder | Excel Programming | |||
Open files in folder - skip if already open | Excel Programming | |||
open all files in a folder and ... | Excel Programming |