I have a macro to sort CSV files in a folder alphabetically
I need to amend this so that the files are sorted in a custom sort order for eg
BTMSales.csv
AtlSale.csv
CPMsales.csv
MWESales.csv
EBR1Sales.csv
BYPSales.csv Etc
It would be appreciated if someone could amend my code
I need to amend this so that the files are sorted in a custom sort order for eg
BTMSales.csv
AtlSale.csv
CPMsales.csv
MWESales.csv
EBR1Sales.csv
BYPSales.csv Etc
Code:
Sub Sort_FolderAphabetical()
Dim sPath
Dim sExtension
Dim oShellApp
Dim oFolder
Dim oFolderItems
Dim oFolderItem
sPath = "c:\Sales Files\"
sExtension = "*.csv"
Set oShellApp = CreateObject("Shell.Application")
Set oFolder = oShellApp.Namespace(sPath)
Set oFolderItems = oFolder.Items()
oFolderItems.Filter 64 + 128, sExtension ' 32 - folders, 64 - not folders, 128 - hidden
For Each oFolderItem In oFolderItems
Debug.Print oFolderItem.Path
Next
End Sub
It would be appreciated if someone could amend my code