+ Reply to Thread
Results 1 to 8 of 8

Auto Hyperlink to existing cell value

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Auto Hyperlink to existing cell value

    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
    Last edited by scott.s.fower; 04-25-2013 at 08:04 PM.

  2. #2
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Re: Auto Hyperlink to existing cell value

    Quote Originally Posted by scott.s.fower View Post
    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.
    Attached Files Attached Files
    Last edited by turist; 04-26-2013 at 11:58 AM.

  3. #3
    Forum Contributor
    Join Date
    11-10-2012
    Location
    istanbul
    MS-Off Ver
    Excel 2013
    Posts
    297

    Re: Auto Hyperlink to existing cell value

    Waiting for any comment or solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1