Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Choosing certain files in directory and one in particular
I have the code below that allows me to narrow the files in play by using
wildcards (*). However, I want what I have below and a particular file "ABC.xls" (in the same directory). How do I add that to the FNames, an "AND" statement? TIA! Sub RegionTotals_Subaccount() Dim basebook As Workbook Dim mybook As Workbook Dim sourceRange As Range Dim destrange As Range Dim rnum As Long Dim SourceRcount As Long Dim FNames As String Dim MyPath As String Dim SaveDriveDir As String SaveDriveDir = CurDir '-------- WHAT FOLDER? ------------------------------------------ MyPath = "Y:\Sales\Raw Data" ChDrive MyPath ChDir MyPath '------------------------------------------------------------ '--------- WHICH FILES? ------------------------------------------ FNames = Dir("CO*RG***-0*.xls") |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
read all the files after choosing a directory | Excel Programming | |||
Files in a directory? | Excel Discussion (Misc queries) | |||
choosing files using an excel list... | Excel Programming | |||
Choosing a directory/file | Excel Programming | |||
Check if directory empty OR no of files in directory. | Excel Programming |