Results 1 to 4 of 4

Specified folder path to select file path

Threaded View

JayEmTee91 Specified folder path to... 10-26-2012, 04:09 PM
BeachRock Re: Specified folder path to... 10-26-2012, 04:15 PM
JayEmTee91 Re: Specified folder path to... 10-29-2012, 08:56 AM
BeachRock Re: Specified folder path to... 10-29-2012, 10:38 AM
  1. #4
    Forum Contributor BeachRock's Avatar
    Join Date
    11-01-2011
    Location
    Oregon, United States
    MS-Off Ver
    Excel 2016
    Posts
    403

    Re: Specified folder path to select file path

    Replace your current macro code to the following:

    Sub Select_Save_Location_and_Hyperlink()
        Dim rLastCell As Range
        Dim Cell As Range
    
    With Application.FileDialog(msoFileDialogFolderPicker)
      .InitialFileName = ActiveWorkbook.Path
      .Title = "Please choose a folder"
      .AllowMultiSelect = False
      If .Show = -1 Then Range("B5").Value = .SelectedItems(1)
    End With
    
        Set rLastCell = Worksheets("YourWorksheet").Range("B" & Cells.Rows.Count).End(xlUp)
        
        For Each Cell In Range("B5", rLastCell)
            If Not IsEmpty(Cell) Then _
                Cell.Hyperlinks.Add Cell, Cell.Text, TextToDisplay:="Folder Path"
        Next Cell
    
    End Sub
    Change ("YourWorksheet") to the name of the sheet where the file path will be created. This is a combination of the first code I provided and the code I gave you the link for above. It works for me to select the file path and then make that path into a link to the folder you selected. I couldn't get it to work with your original code. This doesn't do exactly what you wanted but it does make it a quick process to open the folder where files are saved so you can open them whenever you want.
    Last edited by BeachRock; 10-29-2012 at 10:44 AM.

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