Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

INDEX/MATCH Array Formula within VBA Code

0

Hi, I need to use INDEX/MATCH Array Formula within VBA to lookup a date value that can be between two dates (FROM and TO). The following formula works fine in an Excel spreadsheet but I need to do it within my VBA code.

{=INDEX($C$3:$C$7,MATCH(1,IF($A$3:$A$7 <= E4,IF($B$3:$B$7 >= E4,1)),0))}

Thanks for your help.


Answer
Discuss

Discussion

Your request amounts to an instruction to the motor mechanic to repair the engine using a screw driver. Worksheet functions are one tool, VBA is another. If you want the mechanic to repair the engine, describe what's wrong and leave the choice of tools to him. If you want the repair done using VBA don't instruct to use worksheet functions. You need to post your workbook and your code. 
Variatus (rep: 4889) Feb 22, '19 at 6:45 am
Add to Discussion



Answer the Question

You must create an account to use the forum. Create an Account or Login