Moderatori: Anthony47, Flash30005
Private Sub Workbook_Open()
Dim NextHL As Long, myDir As String
'
myDir = ThisWorkbook.Path
Sheets("myLinks").Select
Range("A:A").Clear
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(myDir)
Set sf = f.SubFolders
For Each f1 In sf
NextHL = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextHL, 1) = f1.Name 'myDir & "\" &
ActiveSheet.Hyperlinks.Add Anchor:=Cells(NextHL, 1), Address:=myDir & "\" & f1.Name
Next
End Sub
Private Sub Workbook_Open()
Dim NextHL As Long, myDir As String
'
myDir = ThisWorkbook.Path
Sheets("myLinks").Select
Range("A:A").Clear
Call ShowFolderListNest(myDir, 0)
End Sub
Sub ShowFolderListNest(folderSpec, ByVal Nest As Long)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderSpec)
Set fc = f.SubFolders
For Each f1 In fc
NextHL = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(NextHL, 1) = String(Nest, ">") & f1.Name
ActiveSheet.Hyperlinks.Add Anchor:=Cells(NextHL, 1), Address:=folderSpec & "\" & f1.Name
Call ShowFolderListNest(folderSpec & "\" & f1.Name, Nest + 1)
Next
End Sub
Torna a Applicazioni Office Windows
Scheda M.Asus P5G41-M SI collegamenti audio con pannello ant Autore: binson |
Forum: Assistenza Hardware Risposte: 7 |
Visitano il forum: Ricky0185 e 59 ospiti