file import and wildcards (1 Viewer)

rube

Registered User.
Local time
Today, 14:54
Joined
Jun 21, 2003
Messages
76
Worked like a Champ, thanks.
 

Fornatian

Dim Person
Local time
Today, 14:54
Joined
Sep 1, 2000
Messages
1,396
this code returns the last file created in a certain directory...

Code:
Dim tmpDate As Date
Dim aFile As String
Dim mypath As String
Dim myname As String

mypath = "c:\temp\"  ' Set the path.
myname = Dir(mypath)   ' Retrieve the first entry.
Do While myname <> ""   ' Start the loop.
    ' Ignore the current directory and the encompassing directory.
    If myname <> "." And myname <> ".." Then

    If (GetAttr(mypath & myname) And vbDirectory) = vbNormal Then
        If FileDateTime(mypath & myname) > tmpDate Then
        tmpDate = FileDateTime(mypath & myname)
        aFile = mypath & myname
        End If
    End If
    myname = Dir
    End If
Loop

MsgBox aFile
End Sub
 

doran_doran

Registered User.
Local time
Today, 08:54
Joined
Aug 15, 2002
Messages
349
quick question...

I am trying to import 1400 text files, they are all in same fixed delimited format. How can I do that?
 

Fornatian

Dim Person
Local time
Today, 14:54
Joined
Sep 1, 2000
Messages
1,396
doran_doran said:
I am trying to import 1400 text files, they are all in same fixed delimited format. How can I do that?

Firstly, you need to start a new thread :)
 

Users who are viewing this thread

Top Bottom