Hello, i have the below code where i am trying to double click a cell to open and browse and select a file, the file path will be pasted one cell to the right of the cell double clicking but it is not coming in as a hyper link or the correct hyper link
VBA Code:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim strFileToOpen As Variant
If Not Application.Intersect(Target, Range("config_FileBrowse")) Is Nothing Then
Cancel = True
Dim strSelectedFile As Variant
Dim Default_Browse_Address As String
Default_Browse_Address = Range("var_FileBrowse_DefaultAddress").Value
With Application.FileDialog(msoFileDialogFilePicker)
.Filters.Clear
.Filters.Add "Excel Files", "*.csv, .xls, .xlsx", 1
.Title = "Choose an Excel file"
.AllowMultiSelect = False
.InitialFileName = Default_Browse_Address
If .Show <> False Then
strSelectedFile = .SelectedItems(1)
ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Value = strSelectedFile
End If
End With
End If
End Sub