Thread: sumif in vba
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RobcPettit[_2_] RobcPettit[_2_] is offline
external usenet poster
 
Posts: 108
Default sumif in vba

Hi Im trying to use =(SUMIF(teams,Home,power)) with vba. teams,home
and power are named ranges. The calc works perfect in excel. Ive
tried
Dim xt As Double
xt = Application.WorksheetFunction.SumIf(Range("teams") , Range
("Home"), Range("Power"))
MsgBox xt.

The reason I want to do this is, in excel the calc is dependent on
other data, and when calculated I dont want the value to change, but
because its calc from other data which changes daily the value changes
to, so I thought Id calc using vba and write the value to appropiate
range then when values change this result wont. Basically its the
previous days result.
Thanks Regards Robert