Roderick_E
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 2,051
Hi there all. I know how to do a sheet1.cells(x,y).formularray = "=formula" but I'm trying to accomplish something a bit different.
Using INDEX MATCH within VBA I can return a simple single column match, such as:
However, what if I wanted do match multiple criteria via VBA? In a formula you would do something like the following but requires control+shift+enter {...}:
This would return a string from column A if string1&string2 matching together in columns B and C.
QUESTION: How do I make this work in VBA?
Excel 2003-2010 in use
Thanks
Using INDEX MATCH within VBA I can return a simple single column match, such as:
Code:
sheet1.cells(x,y) = application.index(sheet2.range("A:A"),application.match(string,sheet2.range("B:B"),0),1)
However, what if I wanted do match multiple criteria via VBA? In a formula you would do something like the following but requires control+shift+enter {...}:
Code:
=index(sheet2.range("A:A"),match(string1&string2,sheet2.range("B:B")&sheet2.range("C:C"),0 ),1)
This would return a string from column A if string1&string2 matching together in columns B and C.
QUESTION: How do I make this work in VBA?
Excel 2003-2010 in use
Thanks