hello
I have a code selects specific cell and specific file and hyperlink and open, but I have many files and this way takes much time from me so I search way to able select multiple cells in specific column and when open the browser and open my folder which contains many folders and each folder contains subfolder and each subfolder contains many files , then it should get all the files in what I select the cells and create hyperlink and open .
Sub CreateHyperLink()
Dim fd As Object, fPath As String, fName As String, cel As Range
Set cel = Application.InputBox("Select a cell", "Add Link to File", , , , , , 8)
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.InitialFileName = Environ("USERPROFILE") & "\" 'default folder path - MUST end with[COLOR=#ff0000] [B]\[/B][/COLOR]
.AllowMultiSelect = False
.Title = "Please select a file."
.Filters.Clear
If .Show = True Then
fPath = fd.SelectedItems(1)
fName = Mid(fPath, InStrRev(fPath, "") + 1, 9999)
Else
Exit Sub
End If
End With
cel.Hyperlinks.Add Anchor:=cel, Address:=fPath, TextToDisplay:=fName
End Sub
.
any idea to make it dyanamically,please?