Hi,
I have a directoy with text files:
123456.txt
882121.txt
854452.txt
They can have any combination of numbers but are never more nor less than 6 characters long.
In the same directory there are files like: newreport.txt
and latestupdate.txt In other words, just your bog standard text files with no numbers in the name.
How do I use the KILL command to delete only those txt files that DO NOT have numbers in their name?
I have tried may things but can't seem to crack this seemingly easy problem?!
EG, the code below delets the files with numers in the names:
Sub KILLTEST()
Dim C As String
C = "??????.txt"
Kill "H:\Distribution\Reports\Prod\" & C
End Sub
I have a directoy with text files:
123456.txt
882121.txt
854452.txt
They can have any combination of numbers but are never more nor less than 6 characters long.
In the same directory there are files like: newreport.txt
and latestupdate.txt In other words, just your bog standard text files with no numbers in the name.
How do I use the KILL command to delete only those txt files that DO NOT have numbers in their name?
I have tried may things but can't seem to crack this seemingly easy problem?!
EG, the code below delets the files with numers in the names:
Sub KILLTEST()
Dim C As String
C = "??????.txt"
Kill "H:\Distribution\Reports\Prod\" & C
End Sub