problem worksheetfunction Match

J

Jean-Yves

Hi all

Why does the following not work
D15 = ML
sub test
dim rngTeam as range
Set rngTeam = Range("D15")
For i = 2 To 36 Step 2
Set rngTeam = Union(rngTeam, wk.Range("D15").Offset(i, 0))
Next i
Debug.Print Application.WorksheetFunction.Match("ML", rngTeam, 0)
Does the range has to be contiguous ?

Regards,

Jean-Yves
 
B

Bob Phillips

Yes, the range has to be contiguous. You can check this by trying it in a
worksheet function.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top