Вы можете использовать следующий код для анализа вложенных папок, а затем использовать его для гиперссылок:
Public Sub Test()
Set fso = CreateObject("Scripting.FileSystemObject")
FolderName = "D:\" 'Replace it with selected folder
Set FSOLibrary = CreateObject("Scripting.FileSystemObject")
Set FSOFolder = FSOLibrary.GetFolder(FolderName)
For Each oSubfolder In FSOFolder.SubFolders
MsgBox oSubfolder
Next oSubfolder
End Sub
РЕДАКТИРОВАТЬ:
Public Sub NonRecursiveMethod()
Set fso = CreateObject("Scripting.FileSystemObject")
FolderName = "D:\" 'Replace it with selected folder
Set FSOLibrary = CreateObject("Scripting.FileSystemObject")
Set FSOFolder = FSOLibrary.GetFolder(FolderName)
i = 1
For Each oSubfolder In FSOFolder.SubFolders
ActiveSheet.Cells(i, "A") = oSubfolder.Name
Cells(i, "A").Hyperlinks.Add Anchor:=Cells(i, "A"), Address:=oSubfolder, SubAddress:=""
i = i + 1
Next oSubfolder
End Sub