Convert formula to vba code

chunu

Board Regular
Joined
Jul 5, 2012
Messages
99
Office Version
  1. 2013
Platform
  1. Windows
  2. Mobile
Hi,
Can some one help me to convert below formula to vba code.
=IFERROR(INDEX($B$3:$B$21,MATCH(MAX(INDEX(SUMIF($B$3:$B$21,$B$3:$B$21,$C$3:$C$21)*(COUNTIF(E$2:E2,$B$3:$B$21)=0)+ROW($B$ 3:$B$21)/1000,)),INDEX(SUMIF($B$3:$B$21,$B$3:$B$21,$C$3:$C$21)+ROW($B$3:$B$21)/1000,),0)),"-")

Thanks
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try the evaluate function ...
Code:
    Evaluate("=IFERROR(INDEX($B$3:$B$21,MATCH(MAX(INDEX(SUMIF($B$3:$B$21,$B$3:$B$21,$C$3:$C$21)*(COUNTIF(E$2:E2,$B$3:$B$21)=0)+ROW($B$ 3:$B$21)/1000,)),INDEX(SUMIF($B$3:$B$21,$B$3:$B$21,$C$3:$C$21)+ROW($B$3:$B$21)/1000,),0)),"-")")
 
Upvote 0
Try the evaluate function ...
Code:
    Evaluate("=IFERROR(INDEX($B$3:$B$21,MATCH(MAX(INDEX(SUMIF($B$3:$B$21,$B$3:$B$21,$C$3:$C$21)*(COUNTIF(E$2:E2,$B$3:$B$21)=0)+ROW($B$ 3:$B$21)/1000,)),INDEX(SUMIF($B$3:$B$21,$B$3:$B$21,$C$3:$C$21)+ROW($B$3:$B$21)/1000,),0)),"-")")

hi,
i have tried this code but not working, not getting any result.
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,175
Members
449,071
Latest member
cdnMech

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