Thanks for your reply
I already tried using
Sub File_List()
Dim strPath As String, strFile As String, i As Long
' Prompt user to select a folder
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = "C:\Temp\" ' Default path
.Title = "Please Select a Folder"
.ButtonName = "Select Folder"
.AllowMultiSelect = False
.Show
If .SelectedItems.Count = 0 Then Exit Sub ' User clicked cancel
strPath = .SelectedItems.Item(1) & Application.PathSeparator
End With
and then merging it with this
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strPath As String, strFile As String
If Target.Count = 1 And Target(1).Column = 1 Then
If Not IsEmpty(Target) Then
strPath = ThisWorkbook.Path & Application.PathSeparator
strFile = Dir$(strPath & Target & ".*")
If Len(strFile) Then
ActiveSheet.Hyperlinks.Add Anchor:=Target.Offset(, 1), _
Address:=strPath & strFile, _
TextToDisplay:=strFile
Else
Target.Offset(, 1).Value = "N/A"
End If
End If
End If
End Sub
but due to almost zero knowledge of coding i don't know how to do it.
Your solution will only create a list of hyperlinks which i have to manually copy and past in-front of each file. In some cases i have 20,000 names in my list whereas there are only 15,000 files. so if i use your solution i have to manually find those 5,000 missing name and apply the hyperlinks to rest.
This is exactly what i need if it gives me option of choosing folder.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strPath As String, strFile As String
If Target.Count = 1 And Target(1).Column = 1 Then
If Not IsEmpty(Target) Then
strPath = ThisWorkbook.Path & Application.PathSeparator
strFile = Dir$(strPath & Target & ".*")
If Len(strFile) Then
ActiveSheet.Hyperlinks.Add Anchor:=Target.Offset(, 1), _
Address:=strPath & strFile, _
TextToDisplay:=strFile
Else
Target.Offset(, 1).Value = "N/A"
End If
End If
End If
Bookmarks