title: excel error 1004 unable to get the countifs property of worksheetfunction class appear
body: <p>hello i really hoping someone can help me with this.
  i want to use countifs in VBA using 3 criteria and has this script</p>
  
  <pre><code>Sub Count()
  Dim DateSmall As Date
  Dim DateBig As Date
  Dim Company As String
  
  
  DateSmall = CDate(Sheet2.Range("C28"))
  DateBig = CDate(Sheet2.Range("E28"))
  Company = Sheet2.Range("B28").Value
  
  
  Set rGo = Sheet1.Range("E10", Sheet1.Range("E" &amp; Rows.Count).End(xlUp))
  Set rCompany = Sheet1.Range("C10", Sheet1.Range("C" &amp; Rows.Count).End(xlUp))
  
  CountIn = Application.WorksheetFunction.CountIfs(rGo, "&gt;=" &amp; DateSmall, rGo, "&lt;=" &amp; DateBig, rCompany, Company)
  
  
  MsgBox CountIn
  
  End Sub
  </code></pre>
  
  <p>but it got error 1004 but when i use 2 criteria using the same script i can this is the script using 2 criteria</p>
  
  <pre><code>Sub Count()
  Dim DateSmall As Date
  Dim DateBig As Date
  
  
  
  DateSmall = CDate(Sheet2.Range("C28"))
  DateBig = CDate(Sheet2.Range("E28"))
  
  
  Set rGo = Sheet1.Range("E10", Sheet1.Range("E" &amp; Rows.Count).End(xlUp))
  
  CountIn = Application.WorksheetFunction.CountIfs(rGo, "&gt;=" &amp; DateSmall, rGo, "&lt;=" &amp; DateBig)
  
  
  MsgBox CountIn
  
  End Sub
  </code></pre>
  
  <p>i hope someona can help me with this . . .</p>
  
  <pre><code>Sheet 1
  02-Oct-14   SSI
  02-Oct-14   SSI
  02-Oct-14   SSI
  03-Oct-14   SSI
  03-Oct-14   SSI
  03-Oct-14   SSI
  07-Oct-14   SSI
  07-Oct-14   SSI
  07-Oct-14   SCI
  03-Oct-14   SSI
  06-Oct-14   SSI
  06-Oct-14   SSI
  06-Oct-14   SSI
  06-Oct-14   SSI
  06-Oct-14   SSI
  03-Oct-14   SSI
  07-Oct-14   SCI
  02-Oct-14   JSU
  02-Oct-14   JSU
  30-Sep-14   JSU
  
  Sheet 2
  SSI     1-Jan-14        10-Jan-16
  </code></pre>