Hyperlink with multiples files

Liên hệ QC

anhthoichoem

Thành viên mới
Tham gia
26/10/08
Bài viết
20
Được thích
1
Chào cả nhà ạ
Chẳng là em có folder hơn 20000 files pdf.
Em làm file excel list các file và dùng chức năng hyperlinks khi kích vào sẽ nhảy đến file đó.
Nhưng mà làm tay thì max phê. Có anh chị nào có cách nào hay tool nào làm tự động thì giúp em được không ạ?
Bài đã được tự động gộp:

sau thời gian tìm kiếm thì em tìm thấy đáp án rồi cả nhạ ạ .
link youtube:
Closed topic
 
Copy code của a be09, bác tham khảo nha:
Do bác ko đưa file lên nên em cũng chịu!
Mã:
Option Explicit
Public fPath As String
Public IsSubFolder As Boolean
Public iRow As Long
Public FSO As Scripting.FileSystemObject
Public SourceFolder As Scripting.folder, SubFolder As Scripting.folder
Public FileItem As Scripting.File

Public Sub ListFilesInFolder(SourceFolder As Scripting.folder, IncludeSubfolders As Boolean)
        
    On Error Resume Next
    For Each FileItem In SourceFolder.Files
    'Hien thi thuoc tinh cua File
        If FSO.GetExtensionName(FileItem) Like "pdf" Then
        
        Cells(iRow, 2).Formula = iRow - 8
        Cells(iRow, 3).Formula = FileItem.Name
        Cells(iRow, 4).Formula = "=HYPERLINK(""" & FileItem.Path & """,""" & "Open File" & """)"
        
    
        iRow = iRow + 1 ' Chon hàng tiép theo
        End If
        Next FileItem
        
        If IncludeSubfolders Then
            For Each SubFolder In SourceFolder.SubFolders
                ListFilesInFolder SubFolder, True
                Next SubFolder
            End If

            Set FileItem = Nothing
            Set SourceFolder = Nothing
            Set FSO = Nothing
 
Web KT
Back
Top Bottom