Results 1 to 5 of 5

Auto hyperlink to files from list

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Auto hyperlink to files from list

    Good morning folk

    I have the code below to create a list of files in a folder on a sheet,,,,, is there a way to automatically have the file names hyperlinked to the files

    Many thanks

    JT
    Dim iRow
    
    Sub ListFiles()
        iRow = 6
        Call ListMyFiles(Range("C1"), Range("D1"))
    End Sub
    
    Sub ListMyFiles(mySourcePath, IncludeSubfolders)
        Set MyObject = New Scripting.FileSystemObject
        Set mySource = MyObject.GetFolder(mySourcePath)
        On Error Resume Next
        For Each myFile In mySource.Files
            iCol = 2
            Cells(iRow, iCol).Value = myFile.Path
            iCol = iCol + 1
            Cells(iRow, iCol).Value = myFile.Name
            iCol = iCol + 1
            Cells(iRow, iCol).Value = myFile.Size
            iCol = iCol + 1
            Cells(iRow, iCol).Value = myFile.DateLastModified
            iRow = iRow + 1
        Next
        If IncludeSubfolders Then
            For Each mySubFolder In mySource.SubFolders
                Call ListMyFiles(mySubFolder.Path, True)
            Next
        End If
    End Sub
    Last edited by JamesT1; 09-01-2014 at 03:41 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Use VBA to auto Hyperlink files based on input
    By zulfaizan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-13-2014, 03:52 AM
  2. [SOLVED] List All Changed Excel Files Today On Drive And Hyperlink (Incl. Subfolders)
    By alienware in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2014, 03:18 AM
  3. Click on a hyperlink to another sheet and auto filter from dropdown list
    By hcyeap in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-24-2013, 02:34 AM
  4. Auto hyperlink to files???
    By mickey331 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-17-2011, 03:30 AM
  5. [SOLVED] Look up actual files from a list in excel and enter as a hyperlink
    By AlistairM in forum Excel General
    Replies: 0
    Last Post: 01-23-2006, 06:40 AM

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