+ Reply to Thread
Results 1 to 5 of 5

Can you paste file *NAMES* into Excel to form a database of them?

  1. #1
    Nat Maxwell
    Guest

    Can you paste file *NAMES* into Excel to form a database of them?

    Question for very advanced users/VBA Programmers
    I have a CD full of engineering drawings which are stored each in a separate
    graphic file and titled each by the name/ID of each drawing.
    I need to develop a database to compare which drawings I have in electronic
    form and which are on hard copy.
    Is it possible somehow to do something - I guess in in VBA - to have Excel
    automatically run through the list of all these electronically stored
    drawings, copy the name of each of these files, and paste this name into a
    database or a list?
    Would much appreciate any help on thism, or even an indication of whether
    this is possible to accomplish in any MS program.


  2. #2
    Bernie Deitrick
    Guest

    Re: Can you paste file *NAMES* into Excel to form a database of them?

    Nat,

    Copy the code below into a code module of an otherwise blank workbook.

    Change the drive letter in the .LookIn line, and run it.

    HTH,
    Bernie
    MS Excel MVP

    Sub FindFilesAndListInfo()
    Dim i As Long

    Cells(1, 1).Value = "File Path"
    Cells(1, 2).Value = "File Date-Time"
    Cells(1, 3).Value = "File Size"

    With Application.FileSearch
    .NewSearch
    .LookIn = "D:\"
    .SearchSubFolders = True
    .FileType = msoFileTypeAllFiles
    If .Execute() > 0 Then
    MsgBox "There were " & .FoundFiles.Count & " file(s) found."
    For i = 1 To .FoundFiles.Count
    Cells(i + 1, 1).Value = .FoundFiles(i)
    Cells(i + 1, 2).Value = FileDateTime(.FoundFiles(i))
    Cells(i + 1, 3).Value = FileLen(.FoundFiles(i))
    Next i
    Else
    MsgBox "There were no files found."
    End If
    End With

    Columns("A:C").AutoFit
    End Sub




    "Nat Maxwell" <Nat [email protected]> wrote in message
    news:[email protected]...
    > Question for very advanced users/VBA Programmers
    > I have a CD full of engineering drawings which are stored each in a separate
    > graphic file and titled each by the name/ID of each drawing.
    > I need to develop a database to compare which drawings I have in electronic
    > form and which are on hard copy.
    > Is it possible somehow to do something - I guess in in VBA - to have Excel
    > automatically run through the list of all these electronically stored
    > drawings, copy the name of each of these files, and paste this name into a
    > database or a list?
    > Would much appreciate any help on thism, or even an indication of whether
    > this is possible to accomplish in any MS program.
    >




  3. #3
    Nat Maxwell
    Guest

    Re: Can you paste file *NAMES* into Excel to form a database of th

    Bernie,

    YOU ARE AWESOME!!!!!
    It did *exactly* what I was looking for!
    Thank you thank you thank you, and may a million stars light your path!

    Sincerely,
    Nat Maxwell

    "Bernie Deitrick" wrote:

    > Nat,
    >
    > Copy the code below into a code module of an otherwise blank workbook.
    >
    > Change the drive letter in the .LookIn line, and run it.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    > Sub FindFilesAndListInfo()
    > Dim i As Long
    >
    > Cells(1, 1).Value = "File Path"
    > Cells(1, 2).Value = "File Date-Time"
    > Cells(1, 3).Value = "File Size"
    >
    > With Application.FileSearch
    > .NewSearch
    > .LookIn = "D:\"
    > .SearchSubFolders = True
    > .FileType = msoFileTypeAllFiles
    > If .Execute() > 0 Then
    > MsgBox "There were " & .FoundFiles.Count & " file(s) found."
    > For i = 1 To .FoundFiles.Count
    > Cells(i + 1, 1).Value = .FoundFiles(i)
    > Cells(i + 1, 2).Value = FileDateTime(.FoundFiles(i))
    > Cells(i + 1, 3).Value = FileLen(.FoundFiles(i))
    > Next i
    > Else
    > MsgBox "There were no files found."
    > End If
    > End With
    >
    > Columns("A:C").AutoFit
    > End Sub
    >
    >
    >
    >
    > "Nat Maxwell" <Nat [email protected]> wrote in message
    > news:[email protected]...
    > > Question for very advanced users/VBA Programmers
    > > I have a CD full of engineering drawings which are stored each in a separate
    > > graphic file and titled each by the name/ID of each drawing.
    > > I need to develop a database to compare which drawings I have in electronic
    > > form and which are on hard copy.
    > > Is it possible somehow to do something - I guess in in VBA - to have Excel
    > > automatically run through the list of all these electronically stored
    > > drawings, copy the name of each of these files, and paste this name into a
    > > database or a list?
    > > Would much appreciate any help on thism, or even an indication of whether
    > > this is possible to accomplish in any MS program.
    > >

    >
    >
    >


  4. #4
    Bernie Deitrick
    Guest

    Re: Can you paste file *NAMES* into Excel to form a database of th

    Nat,

    Now if we could only do that for the paper copies.....

    ;-)

    Bernie

    > YOU ARE AWESOME!!!!!
    > It did *exactly* what I was looking for!
    > Thank you thank you thank you, and may a million stars light your path!




  5. #5
    Nat Maxwell
    Guest

    Re: Can you paste file *NAMES* into Excel to form a database of th

    singing, "If you you believed, if only you believed in miracles, So would I..."
    ;-)

    "Bernie Deitrick" wrote:

    > Nat,
    >
    > Now if we could only do that for the paper copies.....
    >
    > ;-)
    >
    > Bernie
    >
    > > YOU ARE AWESOME!!!!!
    > > It did *exactly* what I was looking for!
    > > Thank you thank you thank you, and may a million stars light your path!

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1