+ Reply to Thread
Results 1 to 8 of 8

Syntax error using Evaluate

  1. #1
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Syntax error using Evaluate

    Hello, what might be wrong with this code?
    If I copy "mysum" contents to a cell and replace "lista" with a defined list, it works just fine.
    But whenever I run this code, it gives me syntax error.
    Please Login or Register  to view this content.
    Last edited by chiidzzz; 07-28-2013 at 05:04 PM.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Syntax error using Evaluate

    I see that your MATCH has the value begin sought argument swapped with the range being searched. Try

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Syntax error using Evaluate

    I still get syntax error

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Syntax error using Evaluate

    Try running
    Please Login or Register  to view this content.
    to see if there are misplaced parenthesis etc.

    Also, lista is a variant. Evaluate will not accept a variant array as an argument for MATCH. You might substitute Sheet2.Range(ActiveSheet.Range("D6").Value).Address for lista in the formula.
    Last edited by mikerickson; 07-28-2013 at 02:43 PM.

  5. #5
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Syntax error using Evaluate

    it works fine with activeCell.Formula ....

  6. #6
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Syntax error using Evaluate

    The error returned is 2015. Something related to 255 characters limitations which I can't understand.
    Last edited by chiidzzz; 07-28-2013 at 04:34 PM.

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Syntax error using Evaluate

    So why do you use with...End with without referring to this object once ?

    Do you know what With...End With means ?



  8. #8
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Syntax error using Evaluate

    Sorry it was by accident, I removed it

+ 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. Why does this evaluate to error value?
    By agarwaldvk in forum Excel General
    Replies: 0
    Last Post: 10-14-2010, 07:27 PM
  2. Evaluate Formula Syntax in VBA code
    By NBVC in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-03-2010, 04:19 PM
  3. VBA evaluate code error
    By Dulanic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2010, 10:39 AM
  4. what should be syntax for evaluate Indirect
    By srinu1264 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2006, 09:30 AM
  5. Evaluate error when using 2
    By crazybass2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2005, 01:06 PM

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