I am trying to read nearly 1000 files in a folder using VBA. I wish the code to pick the file name in an incremental order such as Dummy3_1, Dummy3_2, Dummy3_3, etc. But instead, the current code picks Dummy3_10 after Dummy3_1. How I could make the code to read the file name sequentially. Thanks
Application.ScreenUpdating = False
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Please select a folder"
.ButtonName = "Pick Folder"
If .Show = 0 Then
MsgBox "Nothing was selected"
Exit Sub
Else
FileDir = .SelectedItems(1) & "\"
End If
End With
FiletoList = Dir(FileDir & "")
Do Until FiletoList = ""