I used this loop:
to create an array named 'Y' of dates minus the minimum of the dates i.e. the earliest date. I then tried to take the sum of the dates using WorksheetFunction.Sum(Y) and it returned 0.
Because I was confused, I used this loop to examine the contents of Y:
This showed me that the sum of the elements of 'Y' was greater than 0, as it contained numbers that were greater than 0 and no numbers less than 0.
I then used this loop to create an array of these values:
and then executed WorksheetFunction.Sum(TestArray) and got the sum I expected, which was around 50,000. Has anyone got any idea as to why this might occur?
Thanks in advance,
Rowan
Bookmarks