View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_4_] Dick Kusleika[_4_] is offline
external usenet poster
 
Posts: 595
Default VB + array formulas

On 21 Mar 2007 13:09:38 -0700, wrote:

I have the following VB code

Dim cnt as Integer
ActiveSheet.Evaluate ("SUM(IF('Data'!$K$7:$K
$259<""Cancelled"")*(Data'!$K$7:$K$259<""Reject ""),1,0)")

The above code works fine but when I add the following line

cnt=ActiveSheet.Evaluate ("SUM(IF('Data'!$K$7:$K
$259<""Cancelled"")*(Data'!$K$7:$K$259<""Reject ""),1,0)")

I get a type mismatch error.


The formula is returning an error and can't fit into an Integer data type.

cnt =
ActiveSheet.Evaluate("SUM(IF(('Data'!$K$7:$K$259< ""Cancelled"")*('Data'!$K$7:$K$259<""Reject""),1, 0))")
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com