Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

using range name in Find

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stefi - 26 Jan 2006 10:21 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.