View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Luke Luke is offline
external usenet poster
 
Posts: 142
Default Problems with WorksheetFunction.Index and WorksheetFunction.Match

I've used Index and Match in Excel for some time to take a value from one
worksheet, find it on another and return a different value, looking something
like "Index(range,Match(value,range,0),1)". I am trying to do the same thing
in VBA, but haven't quite got the hang of it. I keep getting an
"Application-defined or object-defined error". Here's what I have (using
some abbreviations for space):

If App.WF.Index(Wkshts("Sheet1").Range(Cells(3,3),Cel ls(LastRow, 3)),
App.WF.Match(Wkshts("Sheet2").Range("A2").Offset(C urrRow,2),
Wkshts("Sheet1").Range(Cells(3,1),Cells(LastRow, 1)), 0), 1) = Value Then
GoTo Line

Feel free to point me toward a more efficient way of doing this. Otherwise,
I would greatly appreciate it if someone could point out why VBA doesn't like
me or my code.