0

I have some code that will look up the values from a different file.

I've already included the path and filename, but it always asks what file will I look up.

Here's my code:

Filename = "C:\data\accounts"    
ActiveSheet.Range("W:W").FormulaR1C1 = _
        "=INDEX('" & Filename & "[Accounts.xlsx]Accounts'!C6,MATCH(C2,'" & Filename & "[Accounts.xlsx]Accounts'!C3,0))"

Do I need to add application.screenupdating?

1 Answer 1

2

It appears that the "C:\data\accounts" needs to include a terminating \ in the string.

Use

Filename = "C:\data\accounts\"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .