Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi all.
I'm trying to do a macro that will have multiple components, and finally realized that I need to do this in steps. My first step is to build a component that will look in a directory for a specific group of some 35 files, out of 750 files. Our IT guy just bought us the new OALtd "Excel 2007 VBA" book, and I wasn't able to locate a specific example of this. I've also looked in the VBA help files and only found the application.filesearch object. And of course, I've found that this no longer works in 2007. I've read some of the posts, as well as Ron De Bruin's post to another individual here and looked at his webpage example: http://www.rondebruin.nl/copy4.htm From what I'm able to make sense of I've found the part that looks in the directory for a specific file. It's his Example_3 sub. About half way through it, the code states: FilesInPath = Dir(MyPath & "*.xl*") I'm curious, with the Dir(), am I able to set a range of files that I want to access, or would I be better off using a For To loop to open one file at a time, over a range? And, if I'm not stating this clearly enough, please ask. As always, thanks again for your responses. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Steve
Read the tip on the page Tip 2: Use only files with a name that start with for example week Use this then FilesInPath = Dir(MyPath & "week*.xl*") See also http://www.rondebruin.nl/copy3.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "SteveDB1" wrote in message ... hi all. I'm trying to do a macro that will have multiple components, and finally realized that I need to do this in steps. My first step is to build a component that will look in a directory for a specific group of some 35 files, out of 750 files. Our IT guy just bought us the new OALtd "Excel 2007 VBA" book, and I wasn't able to locate a specific example of this. I've also looked in the VBA help files and only found the application.filesearch object. And of course, I've found that this no longer works in 2007. I've read some of the posts, as well as Ron De Bruin's post to another individual here and looked at his webpage example: http://www.rondebruin.nl/copy4.htm From what I'm able to make sense of I've found the part that looks in the directory for a specific file. It's his Example_3 sub. About half way through it, the code states: FilesInPath = Dir(MyPath & "*.xl*") I'm curious, with the Dir(), am I able to set a range of files that I want to access, or would I be better off using a For To loop to open one file at a time, over a range? And, if I'm not stating this clearly enough, please ask. As always, thanks again for your responses. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Application.FileSearch | Excel Discussion (Misc queries) | |||
Problems with Application.FileSearch | Excel Programming | |||
What is better: Application.FileSearch or Dir ?? | Excel Programming | |||
Application.Filesearch | Excel Programming | |||
VBA Application.FileSearch | Excel Programming |