Index Match 2-way conversion to VBA code

wytautas

New Member
Joined
Apr 9, 2013
Messages
20
Hello,

I am trying convert index match formula to VBA code and fill 47 cells with it.
Original formula =INDEX(Copy_Match!$B$4:$Y$34;MATCH(P!A557;Copy_Match!$A$4:$A$34;0);MATCH(P!C557;Copy_Match!$B$3:$Y$3;0))

Current code:
Range(ActiveCell, ActiveCell.Offset(47, 0)).Value =
Application.WorksheetFunction.Index(Sheets("Copy_Match").Range("$B$4:$Y$34"),
Application.WorksheetFunction.Match(1, Sheets("Copy_Match").Range("$A$4:$A$34"), 0),
Application.WorksheetFunction.Match(1, Sheets("Copy_Match").Range("$B$3:$Y$3"), 0), 1)

There is error in code, but unable to find it and never converted standart formula.
Maybe someone see mistake?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Do you know you can record putting a formula in a cell with the macro recorder? Why not try that?
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,203
Members
452,617
Latest member
Narendra Babu D

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