+ Reply to Thread
Results 1 to 3 of 3

using range name in Find

  1. #1
    Stefi
    Guest

    using range name in Find

    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.

  2. #2
    Mike Fogleman
    Guest

    Re: using range name in Find

    ..Find is a method of a Range object. Try either Range("OMSZ").Find or
    Range(MyRange).Find.
    Mike F
    "Stefi" <[email protected]> wrote in message
    news:[email protected]...
    > 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.




  3. #3
    Stefi
    Guest

    Re: using range name in Find

    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.
    > Mike F
    > "Stefi" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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.

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1