Beginner looping / summarize question
sub countdates()
sumamt=0
for i=1 to 3
if cdate(cells(i,1))=cdate(1/31/05) then 'assuming row starts w/ 1
sumamt=sumamt+cells(i,2)
else
end if
next i
end sub
"PGJ" wrote in message
...
How do you set up code that loops through a range summarizing items that
meet a certain criteria?
For example, If the date in column A = 01-31-05 then add up the amounts.
Column A Colume B
01-31-05 50.00
01-31-05 100.00
02-01-05 200.00
desired result would be 150.00.
What would the code look like?
Thanks in advance
|