Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default flexible file search & opening

Hi newsgroup,

I'm a little swamped with an excel task - maybe someone could give me some
hints...

I have to open severate files from a folder where there are around 500
files. They are named after the following scheme:

Report 01.02.2005 12.15.xls
Report 01.02.2005 23.59.xls

Now I need to open all files that contain 01.02.2005 in their file name, not
regarding which time they contain. Does someone know how I can open them
flexibly?

TIA and best regards

Markus
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default flexible file search & opening

Dim bk as workbook, fname as String
sPath = "c:\myfolder\"
fname = dir(sPath & "Report*.xls")
do while fname < ""
if instr(1,fName,"01.02.2005",vbTextCompare) then
set bk = workbooks.Open(fname)
' process the file
bk.Close SaveChanges:=False
end if
fname = dir()
Loop


--
Regards,
Tom Ogilvy



"Markus Scheible" wrote in
message ...
Hi newsgroup,

I'm a little swamped with an excel task - maybe someone could give me some
hints...

I have to open severate files from a folder where there are around 500
files. They are named after the following scheme:

Report 01.02.2005 12.15.xls
Report 01.02.2005 23.59.xls

Now I need to open all files that contain 01.02.2005 in their file name,

not
regarding which time they contain. Does someone know how I can open them
flexibly?

TIA and best regards

Markus



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default flexible file search & opening

Hi Tom,


it works great - thanks a lot :o)

Best regards


Markus
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
file search or search files Richad Excel Discussion (Misc queries) 0 October 22nd 09 07:56 PM
opening a file in Excel starts application but dose not open file Bob Shelton Excel Discussion (Misc queries) 1 July 2nd 08 07:51 PM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
Turning a text file name into a search and linking the file as a hyperlink AlistairM Excel Discussion (Misc queries) 1 January 26th 06 04:55 AM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM


All times are GMT +1. The time now is 04:08 PM.

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"