View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Opening multiple workbooks

Sub Macro1()
Dim sName as String
sName = Dir("C:\Data\*.xls")
do while sName < ""
Workbooks.Open Filename:=sName
sName = dir()
Loop
End Sub

--
Regards,
Tom Ogilvy


"ianripping " wrote in message
...
Currently I have a mcro that opens up one workbook: -

Sub Macro1()
Workbooks.Open Filename:="C:\Data\Book2.xls"
End Sub

Can I make this Macro open all .xls files in the current Directory: -
Like

Sub Macro1()
Workbooks.Open Filename:="C:\Data\*.xls"
End Sub

Any ideas?


---
Message posted from http://www.ExcelForum.com/