+ Reply to Thread
Results 1 to 2 of 2

Formula works in Excel but not VB

  1. #1
    Forum Contributor
    Join Date
    07-07-2005
    Location
    England
    MS-Off Ver
    Office 2019 Enterprise
    Posts
    462

    Formula works in Excel but not VB

    Hello,

    can someone help me work out a formula which will work in VB please..

    Excel formula is

    =SUMPRODUCT(--(A1:A1000="DA"),--(B1:B1000="A000"),D1:D1000)

    Which is basically Sum all the values in range D1:D1000 if the cell in column A = "DA" and cell in column B = "A000".

    Formula works fine in the spreadsheet but cannot get the equivalent formula to work in VB. Here is my effort (Which returns the error "Type Mismatch")

    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

    John

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    here's a different approach
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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