
Originally Posted by
scott.s.fower
why cant you use call macroname? then have the code to create the hyperlink
or
I'm guessing that you are using a loop to pull in the file names so why not add the code before the next command
post your code so we can see what you are trying to do, post your workbook (or an example) if your code is vauge
Here is macro code:
Sub ListMyFiles()
Range("B11:f65536") = Clear
Call ListFiles(Range("C7").Value, Range("B11:F11"), Range("C8").Value)
End Sub
Sub ListFiles(ByVal FilePath As Variant, ByRef OutRng As Range, Optional ByVal ListSubfolders As Boolean)
Dim Created As Variant
Dim FileSize As String
Dim oFile As Object
Dim oFolder As Object
Dim oShell As Object
Dim r As Long
Dim SubFolder As Variant
Dim SubFolders As Collection
Dim VideoLength As String
Set oShell = CreateObject("Shell.Application")
Set oFolder = oShell.Namespace(FilePath)
If oFolder Is Nothing Then
MsgBox FilePath & " BULUNAMADI!", vbExclamation
Exit Sub
End If
If SubFolders Is Nothing Then Set SubFolders = New Collection
For Each oItem In oFolder.Items
With oItem
If .IsFolder Then
SubFolders.Add oItem.Path
End If
FileSize = oFolder.GetDetailsOf(oItem, 1)
Created = oFolder.GetDetailsOf(oItem, 4)
VideoLength = oFolder.GetDetailsOf(oItem, 27)
If .IsFileSystem Then
OutRng.Offset(r, 0).Value = Array(.Path, .Name, FileSize, Created, VideoLength)
r = r + 1
End If
End With
Next oItem
If ListSubfolders Then
Set OutRng = OutRng.Offset(r, 0)
For Each SubFolder In SubFolders
Call ListFiles(SubFolder, OutRng, True)
Next SubFolder
End If
End Sub
And attached file explained the requierment.
Thanks in advance for any help.
Bookmarks