+ Reply to Thread
Results 1 to 3 of 3

Getting "..object _worksheet failed..." error with intersect for cell and named range.

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    27

    Question Getting "..object _worksheet failed..." error with intersect for cell and named range.

    Hi,

    Here is my goal and I'm close but I can't seem to solve this error:
    When a user changes a cell value in a column (let's say "I") that I specify, I want to highlight the active cell when the value is not equal to/within a named range (let's say "testrange2").
    My named range ("testrange2") is in a different worksheet in the same workbook.

    Here is my code thus far:
    Please Login or Register  to view this content.
    Here is the error I get:
    Run-time error '1004':
    Method 'Range' of object '_Worksheet' failed

    ..I don't understand what I'm doing wrong. Please help. : )

  2. #2
    Registered User
    Join Date
    09-22-2012
    Location
    The Netherlands
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    36

    Re: Getting "..object _worksheet failed..." error with intersect for cell and named range.

    Intersect is used to see if ranges have overlapping parts, not if they have corresponding values.
    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    Please Login or Register  to view this content.
    Try this, I did it from the workbook module though, so you need to include a check for the sheet or change it a bit.
    I'd also exit the sub after a single error, dont want people to select the entire sheet, use ctrl+enter to enter something and spend the rest of the day pressing the OK button
    'Ignoramus et ignorabimus'

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Getting "..object _worksheet failed..." error with intersect for cell and named range.

    I figured it out, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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