iainmartin100
New Member
- Joined
- Mar 9, 2011
- Messages
- 43
Hi all, I seem to having one of those days
Im trying to write a formula in VBA which refrances a link within the excel document.
In an ideal world I would just use the following:
.Formula = "='C:\Documents and Settings\Imartin\Desktop\[Book2.xls]Sheet1'!$A$1"
The issue is that the link name/location is changable in the document although the tab/cell refrance will be constant.
I have tried the following but am going completly wrong, can someone help?
Dim WW As Variant
WW = ThisWorkbook.LinkSources(xlExcelLinks)
Range("A1").Formula = "='WW Sheet1'!$A$1"
Im trying to write a formula in VBA which refrances a link within the excel document.
In an ideal world I would just use the following:
.Formula = "='C:\Documents and Settings\Imartin\Desktop\[Book2.xls]Sheet1'!$A$1"
The issue is that the link name/location is changable in the document although the tab/cell refrance will be constant.
I have tried the following but am going completly wrong, can someone help?
Dim WW As Variant
WW = ThisWorkbook.LinkSources(xlExcelLinks)
Range("A1").Formula = "='WW Sheet1'!$A$1"