Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB + array formulas

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.

Thanks in Advance

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VB + array formulas

On Mar 21, 7:56 pm, Divakar wrote:
Dim the vairable Cnt as Double

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


I have the followingVBcode


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


I get the same error even after changing the data type to double

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Array Formulas to Regular Formulas Domenick Excel Worksheet Functions 6 August 17th 15 09:16 PM
Convert Array Formulas to Regular Formulas minyeh Excel Worksheet Functions 0 March 21st 10 05:55 AM
Array formulas Lynda Excel Worksheet Functions 3 June 25th 09 03:06 PM
Array Formulas Joe Gieder Excel Worksheet Functions 0 February 19th 09 07:05 PM
Array formulas andreas Excel Worksheet Functions 2 June 1st 05 01:45 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"