Click to See Complete Forum and Search --> : Adding Array Elements


RSH
September 15th, 2001, 10:46 AM
Is there a way to add array elements in a loop instead of like this.

TotalDays = Days(1) + Days(2) + Days(3) + Days(4) + Days(5) + Days(6) + Days(7) + Days(8) + Days(9) + Days(10) + Days(11) + Days(12)

Days of course is an array with the days number assigned in other parts of the program. A loop would be much neater.
THANKS RSH

RSH
September 15th, 2001, 12:03 PM
Dumb question

For D = 1 To 12
TotalDays = TotalDays + Days(D)
Next D

73 RSH