Defined Name Range (Application.Match)
From the immediate window:
Range("C29").Value = "Name1"
Range("A1:A3").Value = application.Transpose(Array("A","B","C"))
res = Application.Match("B",Range(Range("C29").value),0)
? res
2
worked fine for me.
--
Regards,
Tom Ogilvy
"PCLIVE" wrote in message
...
In my code, I'm trying to specify a defined Name range. The specific
defined Name to be used is determined by the contents of C29.
I've tried the following which doesn't work.
res = Application.Match(cell.Value, Range(Range("C29").Value), 0)
If I use that exact range of the defined Name (as seen below), it works as
expected.
res = Application.Match(cell.Value, Range("L2:L50").Value, 0)
Does anyone know how I get get this statement to work accuratly when
referring to a defined Name range?
Thanks,
Paul
|