Results 1 to 13 of 13

Re: Linking and opening jpeg files using hyperlinks/formulas

Threaded View

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,446

    Re: Linking and opening jpeg files using hyperlinks/formulas

    Option Explicit
    
    Sub GetFileNames()
         
        Dim xRow As Long
        Dim xDirect, xFname$, InitialFoldr$
        Dim sn
        Dim i As Integer
        Dim d
        InitialFoldr$ = "C:\" '<<< Startup folder to begin searching from
         
        With Application.FileDialog(msoFileDialogFolderPicker)
            .InitialFileName = Application.DefaultFilePath & "\"
            .Title = "Please select a folder to list Files from"
            .InitialFileName = InitialFoldr$
            .Show
            If .SelectedItems.Count <> 0 Then
                xDirect = .SelectedItems(1) & "\"
                sn = Split(CreateObject("wscript.shell").exec("cmd /c dir " & xDirect & "/b/s").stdout.readall, vbCrLf)
                i = 2
                For Each d In sn
                    ActiveSheet.Hyperlinks.Add Cells(i, "A"), d
                    i = i + 1
                Next d
            End If
        End With
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Linking and opening jpeg files using hyperlinks/formulas
    By IGJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-19-2017, 03:28 PM
  2. Replies: 0
    Last Post: 02-09-2015, 09:37 AM
  3. Replies: 0
    Last Post: 11-03-2014, 11:46 AM
  4. Print PDF, JPEG and TIF files
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-29-2012, 02:44 PM
  5. Linking a cell to a jpeg image
    By TheBigKangaroo in forum Excel General
    Replies: 1
    Last Post: 02-18-2012, 10:35 PM
  6. Opening Excel files and using cell values in formulas
    By denispoulin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2010, 05:12 PM
  7. [SOLVED] jpeg files in excel
    By Andre in forum Excel General
    Replies: 1
    Last Post: 02-05-2005, 05:06 AM

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