+ Reply to Thread
Results 1 to 3 of 3

Unclear Error Message

  1. #1
    Yossi
    Guest

    Unclear Error Message

    Hi,
    I am trying to set a range variable with a defined range, but I get this
    error all the time:
    "Run-time error '1004':
    Application-defined or object-definned error."

    the code is this:
    Sub temp()
    Dim MyRange As Range

    Set MyRange = Names("temp").RefersToRange
    ..
    ..
    ..
    End Sub

    I can't figure it out. Can you help?

  2. #2
    Tom Ogilvy
    Guest

    Re: Unclear Error Message

    Sub temp()
    Dim MyRange As Range

    Set MyRange = ThisWorkbook.Names("temp").RefersToRange
    ..
    ..
    ..
    End Sub

    is a possibility.

    --
    Regards,
    Tom Ogilvy


    "Yossi" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    > I am trying to set a range variable with a defined range, but I get this
    > error all the time:
    > "Run-time error '1004':
    > Application-defined or object-definned error."
    >
    > the code is this:
    > Sub temp()
    > Dim MyRange As Range
    >
    > Set MyRange = Names("temp").RefersToRange
    > .
    > .
    > .
    > End Sub
    >
    > I can't figure it out. Can you help?




  3. #3
    Yossi
    Guest

    Re: Unclear Error Message

    thanks!

    "Tom Ogilvy" wrote:

    > Sub temp()
    > Dim MyRange As Range
    >
    > Set MyRange = ThisWorkbook.Names("temp").RefersToRange
    > ..
    > ..
    > ..
    > End Sub
    >
    > is a possibility.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Yossi" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > > I am trying to set a range variable with a defined range, but I get this
    > > error all the time:
    > > "Run-time error '1004':
    > > Application-defined or object-definned error."
    > >
    > > the code is this:
    > > Sub temp()
    > > Dim MyRange As Range
    > >
    > > Set MyRange = Names("temp").RefersToRange
    > > .
    > > .
    > > .
    > > End Sub
    > >
    > > I can't figure it out. Can you help?

    >
    >
    >


+ 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