View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_351_] mudraker[_351_] is offline
external usenet poster
 
Posts: 1
Default Open all Text files in a folder


Rob


Try (modify path code as required)

Sub OpenFiles()
Dim sDir As String
Dim sPath As String

sPath$ = "c:\Test"
sDir$ = Dir(sPath, vbDirectory)
If sDir = "" Then
MsgBox "Path " & sDir & " Not Found"
End
End If
sDir$ = Dir(sPath & "\*.txt")
Do Until sDir = ""
your code to open text file here
Loop

End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=526961