View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SMS - John Howard SMS - John Howard is offline
external usenet poster
 
Posts: 16
Default Excel XP VBA Array formula

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