View Single Post
 
Old 03-01-2015, 06:08 AM
grexcelman grexcelman is offline Windows 7 32bit Office 2003
Novice
 
Join Date: Dec 2014
Posts: 21
grexcelman is on a distinguished road
Question Translate INDEX(MATCH) into VBA

Been pounding my head on this one. I have the following function which works fine in excel however the VBA result isn't working for me.

{=INDEX($L$6:$R$19,(MATCH(B7&C7,$M$6:$M$19&$L$6:$L $19,0)),3)}

my vba code looks like:

Function FTest(tk as string, tk2 as string, Col as integer)

test = Application.WorksheetFunction.Index (Sheets("Index_Match").Range("M6:M19"), _
Application.WorksheetFunction.Match(Tk, Sheets("Index_Match") .Range("L6:R13"), 0), Col)

Set FTest = test.Value
End Function


My result is coming back as 0.0 which isn't making much sense since my range of data has all text at the moment.

any ideas?
Reply With Quote