Hi All,
I have a range named OMSZ, and I'd like to use this name in Find, but this
line gives an error:
MyVar = ThisWorkbook.Names("OMSZ").Find("StringToSearchFor", [A1], , ,
xlByRows, xlNext).Row
What is the correct syntax?
The named range is OK, because e.g.
MyRange = ThisWorkbook.Names("OMSZ").RefersTo
gives back the correct range.
Mike Fogleman - 26 Jan 2006 11:23 GMT
.Find is a method of a Range object. Try either Range("OMSZ").Find or
Range(MyRange).Find.
Mike F
> Hi All,
>
[quoted text clipped - 6 lines]
> MyRange = ThisWorkbook.Names("OMSZ").RefersTo
> gives back the correct range.
Stefi - 26 Jan 2006 11:58 GMT
Thanks Mike,
having made some experiments I found this form working:
MyVar = ThisWorkbook.Names("OMSZ").RefersToRange.Find("StringToSearchFor",
[A1], , , xlByRows, xlNext).Row
Is there a simpler one?
Regards,
Stefi
„Mike Fogleman” ezt írta:
> ..Find is a method of a Range object. Try either Range("OMSZ").Find or
> Range(MyRange).Find.
[quoted text clipped - 9 lines]
> > MyRange = ThisWorkbook.Names("OMSZ").RefersTo
> > gives back the correct range.