Hello.
I have two workbooks open. The first workbook will always have a different filename but the second workbook will always be called "Chart1". I have a code that inserts the first (unknown) workbook into "Chart1" but for some reason the code is hyperlinking "Charts1" into "Charts1"
!
Dim strText As String
Dim var
strText = Mid(ActiveWorkbook.Name, 15)
strText = Left(strText, Len(strText) - 5)
var = Split(strText, " ")
With Workbooks("Chart1").Sheets("Sheet1").Activate
ActiveCell.Activate
ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:=ActiveWorkbook.FullName, TextToDisplay:=var(0) & " " & var(1)
End With
I think the code is detecting the active workbook as the hyperlinked file which is "Chart1" instead of the previously open workbook. So if the code can take the previous open workbook then I think this code would work properly.
Thanks in advance
Bookmarks