Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
read all the files after choosing a directory M H Excel Programming 5 July 11th 05 04:14 AM
Files in a directory? Greg B Excel Discussion (Misc queries) 5 May 11th 05 09:46 PM
choosing files using an excel list... davidbev008 Excel Programming 1 December 3rd 04 08:23 PM
Choosing a directory/file Srikanth[_6_] Excel Programming 1 August 28th 04 02:16 AM
Check if directory empty OR no of files in directory. Michael Beckinsale Excel Programming 2 December 4th 03 10:12 PM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"