+ Reply to Thread
Results 1 to 6 of 6

Intersect target range error

  1. #1
    Registered User
    Join Date
    01-24-2015
    Location
    Singapore
    MS-Off Ver
    office365
    Posts
    16

    Intersect target range error

    the purpose for this automation is to show BALANCED invoice from "GL" (Data worksheet)

    when I select balance amount shows in column "H", it shows the same amount in column "I", meaning the amount and invoice I want to apply, after that I click " receipt voucher", it link to printing format of receipt voucher to show those I select. which works fine

    I want to add one trick to restrict amount implied in column "I" , which amount applied should not bigger than outstanding amount (which in column "H"), and here is the problem comes.

    it works great after I write code initially, however after I change the "customer" and then click "GET OUTSTANDING" to refresh the data, it pop up errors

    I did some web browse, seem the issue related to Intersect target range function which the target can not refer to the range I want.I have no idea how to solve this problem, really appreciate your kindly help. Please kindly refer to Excel attached for better understanding my question.
    Attached Files Attached Files
    Last edited by AndyLiu; 03-04-2015 at 04:42 AM. Reason: Solved

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,351

    Re: Intersect target range error

    Hi,

    Here are some possible answers:

    1. Your Irr variable come up zero, so Range("I13", "I" & lrr) is invalid.
    2. Private Subs should only work on their own sheets. ? Rea http://www.cpearson.com/excel/Scope.aspx
    3. You might need to change If target > target.Offset(0, -1).Value to If target.value > target.Offset(0, -1).Value
    4. ByVal might need to be changed to ByRef at the top of the Sub.

    Give these a try.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Intersect target range error

    Hi Andy

    Try changing this Line of Code..
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    01-24-2015
    Location
    Singapore
    MS-Off Ver
    office365
    Posts
    16

    Re: Intersect target range error

    thank you so much for your promptly reply:
    1) i have no idea why Irr variable goes to Zero after i clear up the data, the range("I13","I"& lrr) works fine if I do not change the "customer" and refresh the data
    2) i do mean to let this private sub to work its own sheets only.
    3) i tried, its the same error
    4) ByVal change to Byref give me a "Compile Error, procedure declaration does not match description of event or procedure having the same name"

  5. #5
    Registered User
    Join Date
    01-24-2015
    Location
    Singapore
    MS-Off Ver
    office365
    Posts
    16

    Re: Intersect target range error

    Quote Originally Posted by jaslake View Post
    Hi Andy

    Try changing this Line of Code..
    Please Login or Register  to view this content.
    Hi Jaslake,

    thank you for your reply and suggestion, I tried. but still the same issue.

  6. #6
    Registered User
    Join Date
    01-24-2015
    Location
    Singapore
    MS-Off Ver
    office365
    Posts
    16

    Re: Intersect target range error

    Problem solved, its due to my "ClearFirst" tiger the screen update event, so add " Application.EnableEvents = False" before that will run smooth.

    Great thanks for Dan Strong from www.excelvbaisfun.com

    Please refer to revised excel attached. Cheers!~
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Intersect, Target, Range - referencing from another cell, a problem....
    By Barking_Mad in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2014, 09:33 AM
  2. [SOLVED] Multiple Target Intersect Ranges on Same Worksheet
    By Mistweaver in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2013, 04:35 PM
  3. Getting "..object _worksheet failed..." error with intersect for cell and named range.
    By cool1_boy1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2013, 04:17 PM
  4. Problem with Intersect(Target)
    By fcarboni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2012, 09:02 AM
  5. Target.Range.Address Error
    By markshowell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2005, 10:42 AM

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