hello
i got this code the original works well but i try amending by add some message box to avoid the error the message shows but it doesn't happen any thing in col c as was working and i would show in col b the name's file for each subfolder if is possible
Sub fldr()
Dim Fldr As String
Dim SubFldr As Object
Dim i As Long
i = 2
With Application.FileDialog(4)
.AllowMultiSelect = False
If .Show = -1 Then Fldr = .SelectedItems(1)
End With
With CreateObject("scripting.filesystemobject")
If Fldr = "" Then
MsgBox "You didn't select a folder."
Else
MsgBox "You selected this folder: " & Fldr
For Each SubFldr In .GetFolder(Fldr).SubFolders
ActiveSheet.Hyperlinks.Add Anchor:=Cells(i, 3), _
Address:=Fldr & Application.PathSeparator & SubFldr.Name, _
TextToDisplay:=SubFldr.Name
i = i + 1
Next
End If
End With
End Sub
i truly appreciate if anybody can update the code