+ Reply to Thread
Results 1 to 5 of 5

Workbook_SheetChange and If Not Intersect error

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    19

    Workbook_SheetChange and If Not Intersect error

    Hi. I keep getting run-time error 1004 (Method 'Intersect' of object '_Global' failed) when I enter a value in a cell other than the intersect range. The code works just fine when the intersect range is changed, but trips up when I change a cell in some sheets (but not all sheets). It's very strange. Is there something I'm missing here? The goal is to update formatting of a point on a chart depending on which country is selected.

    I can't use the Worksheet_Change event because the country can be changed from the UI, so I need the chart to update even when the user is not on the chart's worksheet.

    Thanks for your help!


    Please Login or Register  to view this content.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Workbook_SheetChange and If Not Intersect error

    which sheet is the country range on? you need to test if Sh is that sheet before you try and use intersect because you can't use intersect with ranges on different sheets
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Workbook_SheetChange and If Not Intersect error

    perhaps
    Please Login or Register  to view this content.
    Last edited by JosephP; 10-25-2012 at 11:10 AM. Reason: amend code

  4. #4
    Registered User
    Join Date
    08-20-2012
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Workbook_SheetChange and If Not Intersect error

    Joseph,

    That worked, thank you. Now though, every time I change any cell on any sheet Excel will pause for a couple seconds of calculation time. I don't know why I didn't think of this before, but since the user is inputting country on the UI, I can just put all of this code in a sub that runs when the user changes the country. (doh!)

    P.S. I used to live just south of Sandy back in the day... loved riding Brighton and Canyons. I hope you guys get some good snow this winter! Take care.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Workbook_SheetChange and If Not Intersect error

    thanks - that'd be nice :-)

+ 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