VBA of Match Formula using R1C1

who am i

New Member
Joined
Oct 28, 2024
Messages
10
Office Version
  1. 2019
Hello and thank you everyone!

I am stumped how to write vba to place a r1c1 index match formula in a column. The match formula would always reference the 1st row. It is R1C1 because the index references a variable. Thanks again! I welcome questions.

VBA Code:
    .Range(.Cells(2, DOWN_PAYMENT), .Cells(Range("a" & Rows.Count).End(xlUp).Row, DOWN_PAYMENT)).Formula2R1C1 = "=INDEX(C[" & 1 + (0 - DOWN_PAYMENT) & "]:C,row(RC),1)"
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Above is the current formula I have, but I want the column reference of the index formula to be match("Material",1:1,0) but I cant figure out how to write R1C1 that would reference the same row.
 
Upvote 0
Nevermind lol. I thought R1 meant 1 after the current row. Solution

VBA Code:
.Range(.Cells(2, DOWN_PAYMENT), .Cells(Range("a" & Rows.Count).End(xlUp).Row, DOWN_PAYMENT)).Formula2R1C1 = "=INDEX(C[" & 1 + (0 - DOWN_PAYMENT) & "]:C,row(RC),match(""Material"",(R1),0))"
 
Upvote 0
Solution

Forum statistics

Threads
1,223,862
Messages
6,175,046
Members
452,606
Latest member
jkondrat14

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