it seems to me that it would be as easy to use a SUMIF formula (or use the function code). If you want a loop you just need one for each statement to iterate through the cells once.