Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to cycle through a series of files in a folder and if the filename does not meet my criteria, then I want to add the filename to my array. This is my loop. How do I add the filename to my array? Sub ParseTextFiles() Dim MyFile As String Dim FSO As FileSystemObject Dim MyFolder As Object Dim ObjFile As Object Dim colFiles As Object Dim MyParsedMessage() As String Dim MyParsedDate As String MyFile = "Z:\Drop Box\robin.tanner\FortexRejects" Set FSO = CreateObject("Scripting.FileSystemObject") Set MyFolder = FSO.GetFolder(MyFile) Set colFiles = MyFolder.Files For Each ObjFile In colFiles MyParsedDate = Application.WorksheetFunction.Substitute(Left(ObjF ile.Name, 10), ".", "/") If Not IsDate(MyParsedDate) Then MyParsedMessage(i) = ObjFile.Name End If Next MsgBox MyParsedMessage(1:i) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding rows to the data array used in an Index function | Excel Discussion (Misc queries) | |||
String Array | Excel Programming | |||
Adding Text to a String | Excel Discussion (Misc queries) | |||
String array initialisation | Excel Programming | |||
Passing a String in Array to Range as String | Excel Programming |