mikeyc - You will also need the full path to the source workbook
VB Code:
Sub CreateLink() Dim sSourcePath As String Dim sSourceBook As String Dim sSourceSheet As String Dim sSourceRange As String Dim sFullAddress As String sSourcePath = "C:\Files\" 'Put the complete path to you source workbook here sSourceBook = "YourSourceWorkbook.xls" 'put the name of your source workbook here sSourceSheet = "YourSheetname" 'put the name of your sdource worksheet here sSourceRange = "B12" 'put the address of the source cell here sFullAddress = "='" & sSourcePath sFullAddress = sFullAddress & "[" & sSourceBook & "]" sFullAddress = sFullAddress & sSourceSheet & "'!" sFullAddress = sFullAddress & sSourceRange Range("C1").Formula = sFullAddress 'Put the cell where you want the link here End Sub




Reply With Quote