Thread: SUMIF in VBA
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
LeeBoWadd[_2_] LeeBoWadd[_2_] is offline
external usenet poster
 
Posts: 1
Default SUMIF in VBA


I see what I missed Thanks for the help. Next question. I
there a way to use range names?
Sub summer()
Dim EnderA As Range
Dim EnderC As Range
Dim EnderD As Range
Dim Acta As String

Range("A7").Select
Set EnderA = Range(Selection, Selection.End(xlDown))
Set EnderC = Range(Selection, Selection.End(xlDown))
Set EnderD = Range(Selection, Selection.End(xlDown))
Range("E7:E1422").Formula = _
"=IF(A7=A6,"""",SUMIF(EnderA,A7,EnderC)"
"-SUMIF(EnderA,A7,EnderD))

--
LeeBoWad
-----------------------------------------------------------------------
LeeBoWadd's Profile: http://www.excelforum.com/member.php...fo&userid=1655
View this thread: http://www.excelforum.com/showthread.php?threadid=31409