+ Reply to Thread
Results 1 to 7 of 7

Target Error

  1. #1
    Forum Contributor
    Join Date
    01-14-2020
    Location
    Pakistan
    MS-Off Ver
    15
    Posts
    123

    Target Error

    HI
    I'm constantly getting error when applying this code or sometime it doesn't even work. where am I going wrong ?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Target Error

    Please Login or Register  to view this content.
    You can't compare an array to a single value.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    01-14-2020
    Location
    Pakistan
    MS-Off Ver
    15
    Posts
    123
    Quote Originally Posted by shg View Post
    Please Login or Register  to view this content.
    You can't compare an array to a single value.
    Ah ok thanks
    What would b the best way to make those codes work.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Target Error

    I don't know what you're trying to do.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi !

    Quote Originally Posted by samarbac View Post
    where am I going wrong ?
    • Remove codelines On Error …

    • Check the syntax where occurs any error …

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Target Error

    You could maybe use CountA to test the range.

    https://support.office.com/en-gb/art...2-53f3219e2509
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: Target Error

    Quote Originally Posted by samarbac View Post
    Please Login or Register  to view this content.
    A suggestion... do not include space characters after your commas for long list arguments for the Range object... while you haven't reached it here (you are not too far off either, and who knows if you might want to extend the list in the future), the maximum length text string argument that can be passed into the Range object is 255 characters (or maybe it's 256, I can never remember which) and all those spaces do is take up valuable space (the spaces are not needed or used by the Range object when evaluating the passed in text string argument).

+ 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. YTD Sales Comparison vs Last Year and vs Target Error
    By franztupaz in forum Excel General
    Replies: 6
    Last Post: 06-13-2019, 01:16 AM
  2. [SOLVED] Intersect target range error
    By AndyLiu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2015, 04:41 AM
  3. [SOLVED] Worksheet_FollowHyperlink(ByVal Target As Hyperlink) Error
    By strud in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2014, 05:47 AM
  4. [SOLVED] Worksheet_Change Event - Target.Name.Name error in certain situations
    By GazP in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2013, 04:14 AM
  5. data is moving both target and error sheets
    By ramserp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2009, 02:53 AM
  6. [SOLVED] Prevent error when deleting row within Worksheet_Change target ran
    By Peter Rooney in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2006, 11:45 AM
  7. Target.Range.Address Error
    By markshowell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2005, 10:42 AM

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