Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have a little problem : I would like to create a macro which opens all .xls files in a specified folder. The number and the name of these files may vary, so the macro should open "*.xls". Is it possible to do that ? Thanks a lot Phil ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 17 Oct 2003 04:44:58 -0400, Thubs wrote:
Hi all, I have a little problem : I would like to create a macro which opens all .xls files in a specified folder. The number and the name of these files may vary, so the macro should open "*.xls". Is it possible to do that ? Thanks a lot Phil ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ It is possible, but you'll have to get the exact file-path for each ..xls-file. Take a look at the 3rd posting on the following webpage: http://www.vbcity.com/forums/topic.a...t%7Cdirectory% 7Clist It features a good example of retrieving the list of all the .csv-files in a user-specified folder. Once you have all the filenames and path of the folder, you could use Workbooks.Open in a for-next loop to open all the .xls-files. HTH CoRrRan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Corran Horn, I'll try that :)
------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this with GetOpenFilename
Sub testing() Dim FName As Variant Dim N As Long Dim S As String FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls", _ MultiSelect:=True) If IsArray(FName) Then For N = LBound(FName) To UBound(FName) Workbooks.Open (FName(N)) Next End If End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Thubs" wrote in message ... Thanks Corran Horn, I'll try that :) ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening Files - Macro | Excel Worksheet Functions | |||
Opening Files Using a Macro | Excel Discussion (Misc queries) | |||
opening multiple files into one workbook, but multiple worksheets.... | Excel Discussion (Misc queries) | |||
How can I view files chronologically when opening multiple files | Excel Discussion (Misc queries) | |||
Opening CSV files with VBA/macro | Excel Programming |