Your content doesn't have trailing 0s, it has leading 0s. That said, if you want to control the sort order of files whose name begins with 'Table', you can use:
x = Format(i , "000")
FileName = "C:\Users\VBA-beginner\Downloads\RPYC\CASS-Tables\Table_" & x & ".txt"
These files will have the same sort order as:
FileName = "C:\Users\VBA-beginner\Downloads\RPYC\CASS-Tables\" & x & "__Table_" & x & ".txt"
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|