malleshg24
08-07-2019, 12:04 PM
Hi Team,
Is there a way to open each files from a folder in ascending order.I am consolidating the data
But files are getting opened randomely and to correct it I am sorting the data in Master File.
Thanks in advance for your help.
Sub LoopThroughFiles()
Dim StrFile As String
StrFile = Dir("c:\testfolder\*test*")
Do While Len(StrFile) > 0
Debug.Print StrFile
StrFile = Dir
Loop
End Sub
Thanks
mg
Is there a way to open each files from a folder in ascending order.I am consolidating the data
But files are getting opened randomely and to correct it I am sorting the data in Master File.
Thanks in advance for your help.
Sub LoopThroughFiles()
Dim StrFile As String
StrFile = Dir("c:\testfolder\*test*")
Do While Len(StrFile) > 0
Debug.Print StrFile
StrFile = Dir
Loop
End Sub
Thanks
mg