Hello,
I am trying to hyperlink a file. The first part of the filename is constant but the end has a variable date. Is there a way to look at the constant portion only when referencing?
For example the file's name is: "EarningsDiscrepancy_0069_2021_20220429_093447_5649"
I would like for it to recognize just "EarningsDiscrepancy" and hyperlink that file.
The file path "strEDFolder" is fine.
My current attempt that is not working:
Dim strAgencyFolder As String
strAgencyFolder = ActiveWorkbook.Path
Dim strEDFolder As String
strEDFolder = strAgencyFolder & "\Support Docs\"
Dim Strfile
Strfile = Dir(strEDFolder & "EarningsDiscrepancy*" & "\*")
Range("C18").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:=strEDFolder & "EarningsDiscrepancy*" & "\*", _
TextToDisplay:="Earnings Discrepancy"
I am trying to hyperlink a file. The first part of the filename is constant but the end has a variable date. Is there a way to look at the constant portion only when referencing?
For example the file's name is: "EarningsDiscrepancy_0069_2021_20220429_093447_5649"
I would like for it to recognize just "EarningsDiscrepancy" and hyperlink that file.
The file path "strEDFolder" is fine.
My current attempt that is not working:
Dim strAgencyFolder As String
strAgencyFolder = ActiveWorkbook.Path
Dim strEDFolder As String
strEDFolder = strAgencyFolder & "\Support Docs\"
Dim Strfile
Strfile = Dir(strEDFolder & "EarningsDiscrepancy*" & "\*")
Range("C18").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:=strEDFolder & "EarningsDiscrepancy*" & "\*", _
TextToDisplay:="Earnings Discrepancy"