Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
flexible file search & opening
Hi Tom,
it works great - thanks a lot :o) Best regards Markus |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
file search or search files | Excel Discussion (Misc queries) | |||
opening a file in Excel starts application but dose not open file | Excel Discussion (Misc queries) | |||
File:1 and File:2 -- Double Files when Opening One File | Excel Discussion (Misc queries) | |||
Turning a text file name into a search and linking the file as a hyperlink | Excel Discussion (Misc queries) | |||
opening an excel file opens a duplicate file of the same file | Excel Discussion (Misc queries) |