+ Reply to Thread
Results 1 to 2 of 2

“Evaluate” a formula with = IF (OR (SUMPRODUCT(…. in VBA

  1. #1
    Registered User
    Join Date
    12-20-2012
    Location
    Aus
    MS-Off Ver
    Excel 2003
    Posts
    2

    Smile “Evaluate” a formula with = IF (OR (SUMPRODUCT(…. in VBA

    Hi All

    Thank you all in advance

    I’m trying to use the following code and it always retunes a #VALUE!

    Please Login or Register  to view this content.
    Cells(lngRow, "S") = Evaluate (“IF(OR(SUMPRODUCT(--($J" & lngRow & "='TC5RARULE ATT'!$P$2:$P$65000),--($M" & lngRow & "='TC5RARULE ATT'!$O$2:$O$65000))>0, SUMPRODUCT(--($J" & lngRow & "='TC5RARULE ATT'!$S$2:$S$65000),--($M" & lngRow & "='TC5RARULE ATT'!$R$2:$R$65000))>0),1,0)")
    Please Login or Register  to view this content.


    But it works fine when I don’t use the 'evaluation'

    Please Login or Register  to view this content.
    Cells(lngRow, "S") = “=IF(OR(SUMPRODUCT(--($J" & lngRow & "='TC5RARULE ATT'!$P$2:$P$65000),--($M" & lngRow & "='TC5RARULE ATT'!$O$2:$O$65000))>0, SUMPRODUCT(--($J" & lngRow & "='TC5RARULE ATT'!$S$2:$S$65000),--($M" & lngRow & "='TC5RARULE ATT'!$R$2:$R$65000))>0),1,0)"
    Please Login or Register  to view this content.


    Can you please help?

  2. #2
    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,428

    Re: “Evaluate” a formula with = IF (OR (SUMPRODUCT(…. in VBA

    I've not really used Evaluate but, from what I've read, it defaults ranges to the Activesheet. So, it may be worth qualifying the $J and $M.

    Regards, TMS
    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


+ 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