Hi there!

Last night a Mod very kindly posted the following formula for me:

=INDEX($1:1,1,MATCH(CD2,2:2,0))

I filled the cells as follows:

=INDEX($1:1,1,MATCH(CD3,3:3,0))
=INDEX($1:2,1,MATCH(CD4,4:4,0))
=INDEX($1:3,1,MATCH(CD5,5:5,0))

And so on, all the way down to

=INDEX($1:365,1,MATCH(CD367,367:367,0))

Although the 366(!) formulas (1 for every day of the year) return the correct result, they slow down the worksheet considerably.

Is there a way that that the same thing could be achieved using VBA, with the objective of running my worksheet as efficiently as it did before?

Many thanks!