Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

formula external link

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Formula with an external link - VBA

Formula with an external link - VBA

ResolvedVersion 2003

Iain has attended:
Access Introduction course
Access Intermediate course
Access Advanced course

Formula with an external link - VBA

Hi,
I have the following simplified array formula in cell A1 Sheet1, If I wanted to update the link within excel itself I would simply click Edit>Links>Change Source and job done.

The issue is that this formula needs to be within a macro and just the result displayed in cell A1 Sheet1

{=INDEX('C:\link.xls]tab1'!$F$1:$F$100,MATCH($H$7&$C$68,'C:\link.xls]tab1'!$C$1:$C$100&'C:\link.xls]tab1'!$D$1:$D$100))}

The user could change the link at any time so I need to somehow refrance the exterenal link? I have tried the following but it doesn't come anywhere close to working, any ideas?

Sub macro3()

Dim WW As Variant
WW = ThisWorkbook.LinkSources(xlExcelLinks)

Range("A1").Formula = "='WW Sheet1'!$A$1"

End Sub

RE: Formula with an external link - VBA

Solved by using the MrExcel forum, Thanks

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Outlining - Grouping rows or columns

Highlight want you want to group and press ALT + SHIFT + left cursor arrow

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.