Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Excel XP VBA Array formula

Thanks Charles.
I will experiment around your suggestions.
"Charles Williams" wrote in message
...
[ ] notation for the Evaluate method requires a string between the []

rather
than a mixture of string and VBA variables.
If you want to construct the string using VBA you should use
Application.Evaluate or worksheet.Evaluate rather than []

Also you need to be careful when using Application.Evaluate with

unqualified
range references like D2:D14 because they refer to whatever happens to be
the active worksheet at evaluation time: safer to use worksheet.evaluate

or
qualified range references.

Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com

"SMS - John Howard" wrote in message
...
The first two sub procedures below work OK

The third one however, produces a Type Mismatch error.

Do VBA Array formulas not accept variable arguments or am I miss-keying
something?

All help gratefully accepted. :-)

Dim rep As String
Dim pco As String

Sub addpco()

Range("K1") = "005522"
Range("L1") = "PRI"

rep = "005522"
pco = "PRI"

TotalPRI = [Sum((A2:A14=K1)*(D2:D14=L1)*(G2:G14))]
MsgBox TotalPRI

TotalPRI = [Sum((A2:A14="005522")*(D2:D14="PRI")*(G2:G14))]
MsgBox TotalPRI

TotalPRI = [Sum((A2:A14=rep)*(D2:D14=pco)*(G2:G14))]
MsgBox TotalPRI

End Sub


Thanks in Anticipation

John Howard
Sydney, Australia






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
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
IF or Array formula excel .. help ! [email protected] Excel Worksheet Functions 2 October 28th 07 04:29 AM
array or IF formula excel help [email protected] Excel Discussion (Misc queries) 2 October 27th 07 02:24 PM
Tricky array formula issue - Using array formula on one cell, then autofilling down a range aspenbordr Excel Programming 0 July 27th 05 03:59 PM
Excel XP Sum Array Formula SMS - John Howard Excel Programming 2 January 15th 05 06:32 AM


All times are GMT +1. The time now is 12:40 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"