Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Worksheet function in VBA

Status
Not open for further replies.

QSM

Technical User
Mar 29, 2007
6
NL
Goodmorning,

I am trying to use a worksheetfunction in VBA to win some time. I want to use the MATCH function to retrieve the row in which a certain item is stored. In this case I don't have to loop through an array.

Function finditem(dataItem)
Dim row DD as variant
rowDD = Application.WorksheetFunction.Match(dataItem, Worksheets("DD").Range("b1:b150"), 0)

I want rowDD to return the rownumber in which dataItem is stored in column B. But the function keeps returning an #value statement in the destination cell of the function. Has anybody an idea what I've done wrong?

Thanks in advance, kind regards.

 


DSM,

VBA code question should be posted in Forum707.

Skip,

[glasses] [red][/red]
[tongue]
 
Oke, thanks! Will repost it there

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top