I need to open many files on one specific OneDrive path that have the following path format:
'Generic OneDrive path' + 'File name that depends on the cell value in C6' + '.xls' + 'path from OneDrive that need to be = to wildcard'.
I tried as below but it opens a webpage error. Please note that I used descriptions in the path file that doesn´t correspond to the real path.
It works if I don´t use the wildcard, But then it´s useless for the aim I am trying to reach.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim DynCellValue As String Const WildCardNeeded As String = ".xls*" If Not Intersect(Target, Range("C6:C10")) Is Nothing Then Application.Cursor = xlIBeam If Target.Address = "$C$6" Then DynCellValue = Range("C6").Value ActiveWorkbook.FollowHyperlink Address:="OneDrivePath" & DynCellValue & WildCardNeeded& "" End If End If Application.Cursor = xlDefault End Sub