I'm trying to copy a formula which refers to another file on my computer but I can't drag with the INDIRECT formula because I get an error (#REF) when the file is closed. I knew this so I was trying to find a solution to the problem and came across the PULL VBA function that was created a while ago. The problem with that solution is that it is impossibly slow for the amount of data I have (I tested on a small sample).
So...I've come up with the idea of writing the formula in each cell using a macro, although I'm not sure how to do it. Hoping someone here can help.
I want to have a formula written in column E which takes part of the name from columns C and D. Here's what I've got:
The problem is that it prints the same thing down the column. I want the formula to grab the city [$C3] and the neighborhood name [$D3] and then do the same for the next row in that column filling the whole range. I've read about incorporating the OFFSET formula as well but am not sure if that's the right thing to do.
What am I doing wrong? Any suggestions?
So...I've come up with the idea of writing the formula in each cell using a macro, although I'm not sure how to do it. Hoping someone here can help.
I want to have a formula written in column E which takes part of the name from columns C and D. Here's what I've got:
Code:
Sub formula()
Range("E3:E694").formula = _
"=VLOOKUP(DATE(year-1,12,31),'M:\Ryan\[State_" & [$C3] & "_2014.xls]" & [$D3] & "'!$C$5:$W$370,20,FALSE)"
End Sub
The problem is that it prints the same thing down the column. I want the formula to grab the city [$C3] and the neighborhood name [$D3] and then do the same for the next row in that column filling the whole range. I've read about incorporating the OFFSET formula as well but am not sure if that's the right thing to do.
What am I doing wrong? Any suggestions?