+ Reply to Thread
Results 1 to 2 of 2

Thread: Invalid call or procedure. Two countifs added together. VBA.

  1. #1
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    423

    Invalid call or procedure. Two countifs added together. VBA.

    Hi there,

    I am adding two application.worksheetfunction.countifs() together in VBA, but I get the "invalid call or procedure" function.

    Am I restricted from adding two countifs together?

    h14 = Application.WorksheetFunction.CountIfs(SPHLongAnalyzable, "Yes", SPHLongPeriod, b11, SPHLongRisk, "No SS/SS", SPHLongSite, e11) + Application.WorksheetFunction.CountIfs(SPHShortAnalyzable, "Yes", SPHShortPeriod, b11, SPHShortSite, e11, SPHShortRisk, "No SS/SS")
    Any ideas?

  2. #2
    Forum Guru mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    3,004

    Re: Invalid call or procedure. Two countifs added together. VBA.

    Do the countifs work individually?
    Do you really mean Range("H14")?
    Martin

    Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK.

+ 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.2.0