Index Match formula Loop

jwburritt

New Member
Joined
May 22, 2019
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hello: I have the following formula that I need to replicate down a column. When I paste it, it works fine. But when I try to put it into a loop, I can't seem to make it work. The failing loop is below.

Thanks!

The Formula: =Cells(i, 5).Formula = "=INDEX('Temp A'!$E$7:$E$19,MATCH(Current!D7,'Temp A'!$D$7:$D$19,0))"

Code:
For i = 1 to 10[INDENT]Cells(i, 5).Formula = "=INDEX('Temp A'!$E$7:$E$19,MATCH(Current!" & Cells(i, 4) & ",'Temp A'!$D$7:$D$19,0))" ' runtime error 1004[/INDENT]

Next i
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Maybe you mean...

Rich (BB code):
Cells(i, 5).Formula = "=INDEX('Temp A'!$E$7:$E$19,MATCH(Current!" & Cells(i, 4).Address & ",'Temp A'!$D$7:$D$19,0))"
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,215,131
Messages
6,123,222
Members
449,091
Latest member
jeremy_bp001

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top